Skip to content

Commit b7310be

Browse files
committed
Update remote lesson with anon e-mails
Reformat for second session.
1 parent d249ef9 commit b7310be

1 file changed

Lines changed: 19 additions & 4 deletions

File tree

_episodes/07_lesson6_remotes.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
layout: page
33
title: Remotes - GitHub
44
order: 7
5-
session: 1
5+
session: 2
66
length: 20
77
toc: true
88
adapted: false
99
---
1010

1111
## Working with Remotes
1212

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.
1414
We then linked our *local repository* with the *remote repository*.
1515
Git then tracks branches on the remote repository.
1616

@@ -28,6 +28,15 @@ git remote show origin
2828
GitHub is useful, since it has extensive tooling to allow collaboration (more on this in the next session).
2929
There are alternative which serve a similar purpose (such as Bitbucket and GitLab).
3030

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+
3140
### Sending Changes to GitHub
3241

3342
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
4251
git push -u origin feature-branch
4352
```
4453

54+
The flag `-u` is the short form of `--set-upstream`.
4555
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.
4656

4757
### Fetch From Remote
@@ -59,6 +69,12 @@ To see this on our local copy, we'll have to use the `--all` flag in `log`:
5969
git log --oneline --graph --all --simplify-by-decoration
6070
```
6171

72+
We can see the remote tracking branches either with `remote show origin` (seen above), or with a doubly-verbose form of `branch`:
73+
74+
``` sh
75+
git branch -vv
76+
```
77+
6278
In order to get these changes onto our branch, we have to fast-forward with `git merge`.
6379
Since this is such a common action (fetch and merge), the two actions are combined into a single command,
6480

@@ -96,8 +112,7 @@ Even if you don't intend on making any changes, you will have a copy which canno
96112

97113
We have seen how to work with remote repositories, and how download and upload changes.
98114

99-
This concludes the first session of the Intermediate Version.
100-
In the next session we will look at typical workflows using GitHub.
115+
In the next remainder of this session we will look at typical workflows using GitHub.
101116
We'll also see how we can rewrite our history, as well as the tools we have available to get unstuck when applying these more complicated changes.
102117

103118
### Exercise

0 commit comments

Comments
 (0)