diff --git a/README.md b/README.md index 9c0a020d..920dcf79 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,9 @@ Other Note: to get help on a particular git command, use `git --help` ~~~ 2. Create an account (or login) to GitHub at -3. (optional) Generate a ssh-key and add it to your GitHub account +3. (optional) Generate a ssh-key and add it to your GitHub account (for more + information see + ) ~~~bash $ ssh-keygen -t rsa -C "email@address.com" @@ -28,37 +30,52 @@ Other Note: to get help on a particular git command, use `git --help` ## Exercise 1: Making Commits -5. Clone the forked repository to your computer +1. Clone the forked repository to your computer ~~~bash $ git clone ~~~ -6. Create and add a new file +2. Create and add a new file ~~~bash $ git add ~~~ -7. Edit the `Readme.md` file, then examine the state of your repo +3. Commit the new file + + ~~~bash + $ git commit -m "message" + ~~~ + +4. Examine the state of your repo with `git status`. ~~~bash $ git status ~~~ -8. Commit everything you have done so far +5. Edit and save your new file, then add it to the staging area. Finally make a + new commit with the edited file. At all stages use `git status` to see how + your repository changes ~~~bash - $ git commit -a -m "message" + $ git add + $ git commit -m "message" ~~~ -9. Make some more commits and view the log +6. Make some more commits and view the log ~~~bash $ git log ~~~ -10. Push the commits to the server +7. Commit everything you have done so far + + ~~~bash + $ git commit -a -m "message" + ~~~ + +8. Push the commits to the server ~~~bash $ git push @@ -72,7 +89,7 @@ Other Note: to get help on a particular git command, use `git --help` $ git checkout -b new_branch ~~~ -2. Edit the `Readme.md` file and commit the result +2. Edit your new file and commit the result 3. Swap back to the master branch ~~~bash @@ -97,7 +114,10 @@ Other Note: to get help on a particular git command, use `git --help` ~~~~~~ 6. resolve the conflict (i.e. edit the conflict markers to match how you want - the file to look like) and commit the result + the file to look like) and commit the result. Use `git log` to see the + resulting commits on the master branch. + + + ## Exercise 3: Collaboration 1. Push the new branch that you created in the previous exercise to your remote @@ -124,10 +149,9 @@ Other Note: to get help on a particular git command, use `git --help` ~~~ 3. Both of you make commits to the new branch. Have one person push their - commits to the remote and the other rebase their own commits on top. Swap - roles and repeat the process. Try merging your commits instead of rebasing to - see the difference between the two commands. + commits to the remote and the other merge these with their own commits. Swap + roles and repeat the process. -4. Once you are happy with the state of your new branch, merge or rebase it onto - your `master` branch and bask in the glow of your new Git skills. +4. Once you are happy with the state of your new branch, merge it onto your + `master` branch and bask in the glow of your new Git skills. diff --git a/funky.txt b/funky.txt new file mode 100644 index 00000000..6ed2604f --- /dev/null +++ b/funky.txt @@ -0,0 +1 @@ +This is funky! And so is this! diff --git a/git_slides.pdf b/git_slides.pdf new file mode 100644 index 00000000..bce26ec6 Binary files /dev/null and b/git_slides.pdf differ