Skip to content

Instantly share code, notes, and snippets.

@henrywang
Last active April 30, 2020 13:12
Show Gist options
  • Save henrywang/c528622f4d64906c51ebafebbc4279a2 to your computer and use it in GitHub Desktop.
Save henrywang/c528622f4d64906c51ebafebbc4279a2 to your computer and use it in GitHub Desktop.

TMUX

  1. copy to system clipboard
  • Normal mode: repfx-y
  • Visual mode: y

mutt

git

git stash -u (safe for git clean)

git add -p (part of file)

git pull --autostash --rebase (rebase and move commit and uncommit on top)

firefox

  1. Back: C-[
  2. Forward: C-]

one Git repository with multiple working trees

$ git worktree add -b hotfix ../hotfix origin/master
Enter ../hotfix (identifier hotfix)
Branch hotfix set up to track remote branch master from origin.
Switched to a new branch 'hotfix'
$ cd ../hotfix
$ cd ../main
$ rm -rf ../hotfix
$ git worktree prune
$ git branch -D <branch-name>
$ git fetch upstream
$ git checkout -b whizbang upstream/master
$ git pull
or
$ git pull --rebase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment