Skip to content

Commit 1ec7ff2

Browse files
committed
More updates to session 2
1 parent b1b0559 commit 1ec7ff2

File tree

4 files changed

+2234
-2195
lines changed

4 files changed

+2234
-2195
lines changed

_sessions/c1s2/1_using_git.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,6 @@ Adding files to a git repository is actually a two-stage process: first you have
8888

8989
3. To check this worked run the command
9090

91-
git status
91+
git status
92+
93+

_sessions/c1s2/2_pushing_to_github.md

Lines changed: 53 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,65 @@ There are several ways of getting GitHub to publish your site as a GitHub page.
1414

1515
### Pushing code up to github
1616

17-
To push code up to GitHub, in the GitHub app select the 'Push to Github' button (on the top right). You'll be prompted to choose a name (which might as well be `first_site`).
17+
Go to github, login, and click "Create New Repo" in the top left hand corner.
18+
19+
![Creating a repo on GitHub](/assets/create_repo.png)
20+
21+
Follow the instructions, calling it something like `first_site`. **Do not** click the box which says 'Create a readme with this repository'. You'll get to a page when it'll describe how to get your code online. You want to follow the instructions for "Pushing an existing repository to github".
22+
1823

1924
{% exercise %}
2025
1. Log in to GitHub and check you've verified your email address.
21-
1. In the 'Branches' panel of the GitHub app, change the name of the current branch from `master` to `gh-pages`.
22-
2. Click the 'Push to Github' button in the GitHub app.
26+
2. Change the name of your master branch to 'gh-pages'.
27+
3. On github create a new repository called 'first_site'.
28+
4. Push your code up to github.
2329
3. On Github check you can see your `first_site` code.
2430
4. On the code page on github, click on Settings. It should tell you (about half way down) the url where they've published your site. Have a look to see whether you can see it!
25-
5. (If you finish early) Make a change to `index.html` in Sublime Text. Commit the change to the repository and then push it to GitHub. Make sure you can see the change in the code on GitHub and also in the published page.
31+
5. (If you finish early) Make a change to `index.html` in Sublime Text. Add and commit the change to the repository and then push it to GitHub. Make sure you can see the change in the code on GitHub and also in the published page.
2632
{% endexercise %}
2733

28-
### Creating a git repository, adding and committing with Source Tree
34+
### Git with source tree
35+
36+
#### Change the branch name to 'gh-pages'
37+
38+
1. Go to the branches section on the right hand side.
39+
2. Right-click on the name and select 'rename'.
40+
41+
#### Pushing to github for the first time
42+
43+
1. In the 'Repository' menu, click 'Add remote'.
44+
2. Copy the git url (from the bottom right) on github, and copy it into the source tree 'URL/path' box.
45+
46+
#### Pushing for a second time
47+
48+
### Git with the command line
49+
50+
#### Change the branch name to 'gh-pages'
51+
52+
1. Using the command line, navigate to the repository folder.
53+
2. Run the command:
54+
55+
git branch -m gh-pages
56+
57+
3. To check this worked, run the command:
58+
59+
git branch -a
60+
61+
#### Pushing to github for the first time
62+
63+
We're assiming here that you've just created your repository and are on the github new repository screen.
64+
65+
![Push repo to GitHub](/assets/push_repo_github.png)
66+
67+
If you've set up ssh keys, go for the ssh option, if not, go for https. You should end up doing something like:
68+
69+
$ git remote add origin [email protected]/yourusername/first_site.git
70+
$ git push -u origin master
71+
72+
You might now be prompted to add your github username and password (if you're doing the https method). If all goes well, when you go to github you should see the `first_site` folder containing your html file.
73+
74+
#### Pushing to github for a second time
2975

30-
#### To
76+
1. In the repository folder, run the command
3177

78+
git push

0 commit comments

Comments
 (0)