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: _episodes/07_lesson6_remotes.md
+19-4Lines changed: 19 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,15 +2,15 @@
2
2
layout: page
3
3
title: Remotes - GitHub
4
4
order: 7
5
-
session: 1
5
+
session: 2
6
6
length: 20
7
7
toc: true
8
8
adapted: false
9
9
---
10
10
11
11
## Working with Remotes
12
12
13
-
At the start of the session we first created our repository on GitHub.
13
+
At the start of the first session we created our*remote* repository on GitHub.
14
14
We then linked our *local repository* with the *remote repository*.
15
15
Git then tracks branches on the remote repository.
16
16
@@ -28,6 +28,15 @@ git remote show origin
28
28
GitHub is useful, since it has extensive tooling to allow collaboration (more on this in the next session).
29
29
There are alternative which serve a similar purpose (such as Bitbucket and GitLab).
30
30
31
+
### Aside: Anonymising Your E-Mail
32
+
33
+
We are potentially going to be pushing changes to public repositories.
34
+
If you would rather not have the commits associated with your e-mail address, we can use an anonymised GitHub one.
35
+
This e-mail address has the form `########+USERNAME@users.noreply.github.com`, with digits and your username, and can be found through your GitHub user settings under E-mail:
36
+
37
+
- There is a tick-box for using this substitution e-mail address for actions on GitHub;
38
+
- and this is where you can find the e-mail address to use with `git config --global user.email`.
39
+
31
40
### Sending Changes to GitHub
32
41
33
42
Since we are working with our own repository, we have the relevant permissions to upload our local changes to our remote repository.
@@ -42,6 +51,7 @@ When uploading a new branch, we can specify that we want git to keep track of di
42
51
git push -u origin feature-branch
43
52
```
44
53
54
+
The flag `-u` is the short form of `--set-upstream`.
45
55
If we use `git checkout` and supply a branch-name that only exists on a remote, git will automatically set up branch tracking for us.
46
56
47
57
### Fetch From Remote
@@ -59,6 +69,12 @@ To see this on our local copy, we'll have to use the `--all` flag in `log`:
0 commit comments