-
- Git Basics
- Learn Git Branching
- Common git commands in a day-to-day workflow
- Git Resolve Conflicts
- Git revert vs reset
- Git log cheat sheet
- Compare two branches with git diff
-
-
git diff branch_1..branch_2
-
git log branch_1..branch_2
-
-
- Git merge failed with “already up to date” with a previous revert
- Git create a new branch
- Git Diff name only
- Git Find and restore a file. First, the the commit id when the file was deleted.
git log --diff-filter=D --summary
Then, apply the id in checkout.
git checkout $commit~1 path/to/file.ext
- Git rewrite local branch with remote branch
git reset --hard origin/branch name
- Git undo possibilities
- Git Stash
git stash git stash list git stash apply stash@{2} (If you don’t specify a stash, Git assumes the most recent stash and tries to apply it)
- Great link for detached head
- Fix password authentication removed error
- Finding git commit hash by message keyword
git log --oneline|grep keyword
- Get commit prior to a known commit hash (case of multiple parents)
git show --format="%P" hash