Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Overbeeke, Lennert van
git-started
Commits
2a15a286
Commit
2a15a286
authored
Aug 27, 2019
by
Overbeeke, Lennert van
Browse files
Update chapter 2
parent
c463fdc0
Changes
1
Hide whitespace changes
Inline
Side-by-side
02_getting_git/README.md
View file @
2a15a286
...
...
@@ -71,15 +71,42 @@ through the **command line**.
## Step 3. Clone this repository
-
Run
```cd C:/path/to/your/folder/```
to go to the parent folder for your project folder
The following command will create the project folder for you.
-
Run
```git clone https://git.wur.nl/overb015/```
and see what happens.
-
Run
```git clone https://git.wur.nl/overb015/```
## Step 4. Authenticate yourself
## Step 4. Push your changes to the remote
When you make changes to the contents of a repo, and you want to apply them to the project,
you can
**push**
your changes to the remote.
-
Make a changes to the repo, such as adding a line to the README.md or creating a new file.
-
Open a terminal and go to the project directory.
-
Run
```git add .```
; note the space and period at the end of the command
This command adds your changes to a new
**commit**
(a set of changes).
If you change more things after running this command,
run it again to add the newly made changes too.
-
Run
```git commit -m "short description of the changes in this commit"```
The
```-m```
flag signals that you want to add a message to the commit.
The message is important when you want to find back these changes later on.
-
Run
```git push origin master```
to push
**your**
commits to
**git.wur.nl**
.
Here,
**origin**
refers to the remote at git.wur.nl
and
**master**
refers to the branch on the remote that your changes apply to.
-
Read the response in the terminal. Were you allowed to change the master branch at git.wur.nl?
## Step 5. Authenticate yourself
In the previous step, you ran a command to download data from the Git repo at WUR,
which is a secured environment.
You need to authenticate yourself as a WUR user to access git.wur.nl from the terminal.
> TODO: add steps for authentication by trying this with a new user.
For Windows:
-
open the Start menu
-
type
```credential manager```
and hit Enter
-
next to
**Generic Credentials**
, click
**Add a generic credential**
-
Address:
```git:https://git.wur.nl```
-
User name: your WUR e-mail address
-
Password: your WUR account password
Now, close and restart the terminal and try
**pushing**
again.
When you commit changes from your local repo to the remote,
your identity is sent along with it.
This is how everybody knows who did what in the project.
## Step 5. Pulling changes from the remote
Once you have your local copy in place,
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment