This is a draft cheat sheet. It is a work in progress and is not finished yet.
Branch List
List branch tree view |
|
Ex: |
git log --graph --pretty=medium --abbrev-commit
|
List changed files |
git ls-tree --name-only [branch-name]
|
List all branches |
|
Show branches and their commits |
|
Merge
Mergetool help |
git mergetool --tool-help
|
Tell git to use opendiff |
git mergetool -t opendiff
|
Merge changes |
git merge [merge from branch] (must be on merge into branch) |
|
|
Commands
Show differences |
git diff --name-only [branch1] [branch2]
|
Staus of changes |
|
Add change/file to be committed |
|
|
|
Commit changes |
git commit -m "Your message here"
|
Commit changes - Vim editor save |
esc - :w ( save ) - :q ( quit ) |
Create new branch |
git checkout -b [New Branch Name]
|
Remove file from commit - Step 1 |
|
Remove file from commit - Step 2 |
git commit --amend if a commit was performed |
Ignore files |
create .gitignore file - add file names to ignore |
Remove from add |
git reset [filename.txt]
|
|
|
|