git add -u
git checkout -- filepath
git commit --amend
git reset HEAD
git reset HEAD -- filepath
git reset --soft HEAD~
git reset HEAD~
git reset --hard
git reset --hard ORIG_HEAD
git diff --staged
show diff between HEAD and both staged and unstaged changes (what would be committed with 'git commit -a')
git diff HEAD
git diff --stat branch1...branch2
git log --graph --oneline
git merge-base branch1 branch2
git status | grep deleted | awk '{print $3}' | xargs git rm
git remote show origin
git remote add origin [email protected]:rgreenjr/foobar.git
git push -u origin FEATURE_BRANCH
git fetch origin git checkout --track origin/branch_name
git push origin --delete branch_name
git remote prune origin
rebase development branch onto local feature branch (usually prior to merging feature branch onto development branch)
git checkout branch_name git rebase development
git checkout development git merge --no-ff branch_name
https://github.com/edx/edx-platform/wiki/How-to-Rebase-a-Pull-Request
#############################
#############################
git clone [email protected]:USERNAME/FORKED_PROJECT.git
git remote add upstream [email protected]:UPSTREAM_USER/ORIGINAL_PROJECT.git
git remote -v
git checkout -b FEATURE_BRANCH
git push -u origin FEATURE_BRANCH
git fetch upstream git checkout master git merge upstream/master
git checkout FEATURE_BRANCH git rebase master