You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: resources/prep/git.md
+20-20Lines changed: 20 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,15 +4,15 @@
4
4
5
5
[Git](https://git-scm.com/) is a popular version control system that is the foundation of most open source software development. You are not required to be a Git pro in advance of this event, but come prepared to learn a lot about it! [GitHub](https://github.com) is a hosting service for Git repositories, enabling us to share code across teams in a web environment.
6
6
7
-
We will use Git and GitHub for collaborative work. Be sure to arrive at OceanHackWeek with your own [GitHub](https://github.com/) account.
7
+
We will use Git and GitHub for collaborative work. Be sure to arrive at OceanHackWeek with your own [GitHub](https://github.com) account.
8
8
9
9
## Git Installation
10
10
11
11
* Windows
12
12
* Install Git for Windows from this [link](https://gitforwindows.org/). For more setup details follow these [instructions](https://carpentries.github.io/workshop-template/#shell)
13
13
* Mac OS
14
14
* Download the [git installer](https://git-scm.com/download/mac) and run it.
15
-
* Linux (Debian): `sudo apt install git-all`
15
+
* Linux (Debian/Ubuntu): `sudo apt install git-all`
16
16
17
17
To test, open the terminal (on Windows, Git Bash) and setup your username and email:
18
18
@@ -29,7 +29,7 @@ During the hackweek it will be useful to know how to navigate between files from
29
29
30
30
## Terminal (command line) text editor
31
31
32
-
When working on the command line (the terminal or shell), it is often handy to modify file content directly from there. For that you can use a command line editor such as [nano](https://linuxize.com/post/how-to-use-nano-text-editor/). On Mac and Linux it is usually pre-installed, but for Windows you can follow the instructions in this [link](http://carpentries.github.io/workshop-template/#editor)to set it up. Test your installation by opening a terminal and running `nano --version`. If it works you can link your git configuration with `nano`:
32
+
When working on the command line (the terminal or shell), it is often handy to modify file content directly from there. For that you can use a command line editor such as [nano](https://linuxize.com/post/how-to-use-nano-text-editor/). On Mac and Linux it is usually pre-installed, and on Windows it is installed when you install Git (see [here](http://carpentries.github.io/workshop-template/#editor)for more information about nano and its configuration). Test your installation by opening a terminal and running `nano --version`. If it works you can link your git configuration with `nano`:
Steps 1-5 focus on the Git "centralized workflow". We present it here as an illustration, but **the workflow we recommend for use in OceanHackWeek is the Git Fork - Clone workflow, discussed in Step 6.**
43
43
```
44
44
45
-
46
45
### 1. Create a project repository
47
46
48
-
On your own or someone in your project group (preferably one who has never done it before), create a repository for the project under the {OceanHackWeek organization, [https://github.com/oceanhackweek](https://github.com/oceanhackweek)
47
+
On your own or someone in your project group (preferably one who has never done it before), create a repository for the project under the `oceanhackweek` organization, `https://github.com/oceanhackweek`
49
48
50
49

51
50
@@ -58,13 +57,13 @@ Click `New` and follow the steps: check yes to create a `README.md` file.
58
57
59
58
### 2. Clone the repository
60
59
61
-
Each participant should clone the repository so they have their copy on their JupyterHub account space (and locally in the participant's computer, if desired). Navigate through the terminal to the folder where you want to keep {OceanHackWeek work (`cd path_to_oceanhackweek`).
60
+
Each participant should clone the repository so they have their copy on their JupyterHub account space (and locally in the participant's computer, if desired). Navigate through the terminal to the folder where you want to keep OceanHackWeek work (`cd path_to_oceanhackweek`).
From now on you will push to `origin`, but pull from `upstream`.
@@ -192,7 +191,7 @@ Make some changes to a file and commit and publish them.
192
191
```bash
193
192
git add README.md
194
193
git commit -m "more changes"
195
-
git push origin master
194
+
git push origin main
196
195
```
197
196
198
197
```{admonition} Note
@@ -240,6 +239,7 @@ git revert HEAD
240
239
Your files in the local repo will still be there.
241
240
```
242
241
242
+
243
243
## References and Resources
244
244
245
245
Git and GitHub are very powerful tools but no doubt the learning curve is steep. Learning is an iterative process so below we list some resources which can help you be better prepared:
0 commit comments