$EDITORgit commitgit commitgit init$EDITORgit addgit status
git commitReview status with git status
View changes with git diff
git blame
git branch mastergit checkout -b featuregit checkout mastergit merge master
git log
commit c0f3b38e959fbd43888ffb0aed52289f0a0fd132 (HEAD -> gh-pages, origin/gh-pages, origin/HEAD)
Author: Eddie Schoute <censored@gmail.com>
Date: Wed Nov 29 12:50:11 2017 -0500
Added .gitignore
commit c0fvev3df94c763d23ec8d41b37a0e9e7e7ef39f
Author: Eddie Schoute <...@gmail.com>
Date: Wed Nov 29 12:49:30 2017 -0500
Added slides for newlines and diff.
git checkout c0fvev3git pullgit pushgit pull before pushing.
git pull = git fetch + git merge
Uh-oh
animals.md:
# Favorite animal
Horse
Dolphin
animals.md:
# Favorite animal
Horse
Chicken
git pull gives a merge conflict!
git status:
On branch master
You have unmerged paths.
(fix conflicts and run "git commit")
(use "git merge --abort" to abort the merge)
Unmerged paths:
(use "git add <file>..." to mark resolution)
both modified: animals.md
no changes added to commit (use "git add" and/or "git commit -a")
animals.md:
# Favorite Animal
Horse
<<<<<<< HEAD
Dolphin
=======
Chicken
>>>>>>> branch1
Use your editor and fix manually:
# Favorite Animal
Horse
Dolphin
Chicken
Then git add animals.mdgit commit
Run "git" (or git help <command>)
git <command> (or just run "git" for help):
init: Initialise git repo.status: Check status of repo. Use often!add: Add a file to staging (before committing).commit: Create a commit with your changespull: Pull changes from a remote repository.push: Push changes to a remote repository.branch: Create a branch.merge: Merge a branch.checkout: Switch to a branch.Forked from think-git by Dheepak Krishnamurthy