Skip to content

Instantly share code, notes, and snippets.

@wilmoore
Last active December 9, 2021 18:54
Show Gist options
  • Save wilmoore/8be0199a1f3798bffa308406b65cbd26 to your computer and use it in GitHub Desktop.
Save wilmoore/8be0199a1f3798bffa308406b65cbd26 to your computer and use it in GitHub Desktop.
Income Sources :: Guides :: Git

Income Sources :: Guides :: Git

⪼ Made with 💜 by realpolyglot.dev

Git

How to Undo a Merge in Git

...

git checkout new/api-0001-add-screenshots-resource
git pull
git checkout -
git merge new/api-0001-add-screenshots-resource
git conflicted
git diff api/routes/index.ts
git checkout --ours api/routes/index.ts

one branch every \n

git branch | awk -F'*' '{ print $1,$2 }' | tr -d ' '

interactive, select branch

git branch | awk -F'*' '{ print $1,$2 }' | tr -d ' ' | fzf

interactive, select branch & checkout

git checkout (git branch | awk -F'*' '{ print $1,$2 }' | tr -d ' ' | fzf)

checkout last branch selected

git checkout -

merge previously activated branch

git merge @{-1}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment