A dummy Git workshop using a website of the history of computer executable files.
- Create a page
- Learn how to use Git interactive add
- Sign-up for a GitHub repo
- Split into 2 teams
- The primary coder should rotate when you see ROTATE.
- OPTIONAL Install gource.
-
Choose to make 1 of the following (as an entire team)
- Before ELF (before-elf.html)
- ELF (elf.html)
-
Create a header.
-
Create 1 paragraph.
-
Create a 3 item list.
-
DO NOT COMMIT.
-
Do not do any styling yet.
git add FILENAME
git status
git reset FILENAME
git diff
git diff --cached
git log
git log --oneline
git log --oneline --graph
git log --oneline --graph --decorate --color
git show
git push origin master
- ROTATE
git pull origin master
git branch MYNAME-CHANGES
git checkout MYNAME-CHANGES
git log
- Change the header contents on your webpage.
- Add 3 more items to your list.
git add -i
h
- Learn how to use interactive add!
- Alternatively, if you just want to use only patch:
git add -p FILES
- Add the header, and only the 1st and 3rd item.
git commit
git push origin MYNAME-CHANGES
- Follow the instructions to create a new upstream branch
- ROTATE
- Change to another person, have them pull the branch
git pull origin MYNAME-CHANGES
- Go onto master
git checkout master
- From master, merge changes from another branch
git merge MYNAME-CHANGES
- Any conflicts?
- Create headers for N more sections on your page on master (where N = number of people on your team)
- Add, commit, push them to master
- ROTATE TO ALL OTHERS
- Have every person work on a section on their own branch
- Have every person push their branch upstream to their own branch
- HAVE ONE PERSON CHANGE THE PAGE'S HEADER
- ROTATE TO ORIGINAL
- Have the person merge every new branch into master.
- Merge conflict? Manually edit the file to look the way you want, then save it, add it and commit your changes.
- Create a branch called
rebase-practice
- Go onto it.
- Go into
git rebase -i
- Change a commit's message.
- go into
git rebase -i
- Squash two commits into one.
- Prepare a SINGLE commit.
- This can be nicer when you're looking to contribute to open-source projects
- Go back to master, make a new branch called
pull-request-PAGE-NAME
- Push it upstream as a new upstream branch
- Go onto your fork on GitHub.
- Prepare the pull request to uhmanoa-transpiler-project/git-workshop-fall-2017
- Make the changes, and make a commit.
- Squash? Merge? Rebase?
- After I merge in to master,
git remote add <URL OF UPSTREAM REPO>
git pull --rebase upstream master