Week 4

Summary - John's Notes

Commands

  • git branch <branch_name> - Creates a new branch with a given name
  • git checkout <branch_name> - Switches to a new branch
  • git log -n1 - Limits the output of the log command to only a single commit
  • git branch -v - Verbosely list all local branches
  • git show <reference> - Show the information pointed to by the reference
  • git merge <branch_name> - Merge in a given branch to the current one
  • git checkout -b <branch_name> - Create a new branch and switch into it in one go
  • git reset --hard <commit_ref> - Reset a branch to a specific commit reference
  • git log --graph --pretty=oneline --all --abbrev-commit --decorate - Shows a graphical view of the repository
  • git log --graph --oneline --all --decorate - A shorter form of the above command
  • git branch -d <branch_name> - Delete a branch that has already been merged
  • git branch -D <branch_name> - Forcibly delete a branch
  • git branch <branch_name> <commit_ref> - Create a new branch, starting at the commit reference
  • git reset --merge - Abort a merge and reset back to pre-merge state
  • git diff <commit_1> <commit_2> -- <files> - Show the difference between the two commits, for certain files

Terminology

  • Conflict - A conflict occurs when an attempt is made to reconcile multiple changes to the same section of a file at the same time.
  • Fast-Forward Merge - The simplest merge type, which simply winds a branch forward in time to meet the tip of another.

Previous Day

Next Day

 
   
home | download | read now | source | feedback | legal stuff