Last active
November 15, 2018 13:08
-
-
Save defilerc/cd858ee47efbbef84d3b093043eba212 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# undo last commit (not pushed) | |
git reset HEAD~ | |
# delete remote branch | |
git push origin --delete feature/login | |
# stash changes, including untracked files and give a store message (git save has been deprecated in favor of git push) | |
git stash push --include-untracked --message "publish scripts & command performance tests" | |
# commit partial file changes | |
git add -p <filename> # (-p is short for --patch) | |
# [y,n,q,a,d,K,g,/,e,?] y: yes, n: no, q: quit, a: all (stage entire file), d: (do not stage file at all), K: (skip hunk), | |
# g: select specific hunk, / (search hung using regex), e: (edit hunk), ? (print help) | |
# revert changes to local copy only (index not included) | |
git checkout . | |
# unstage files | |
git reset | |
# when "cannot lock ref 'refs/remotes/origin/current_visa_direct': unable to resolve reference | |
# 'refs/remotes/origin/current_visa_direct': reference broken | |
rm .git/refs/remotes/origin/(dir name) | |
git fetch | |
# git rebase -i (interactively) -p (squash merge commits). rebase <source> to <target> example: | |
git checkout <source> | |
git rebase -i -p <target> | |
git checkout <target> | |
git merge <source> | |
# abort rebase | |
git rebase --abort | |
# skip conflict in current commit | |
git rebase --skip |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
👯♀️