You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rebase the changes branch-base..branch-head onto the master branch
git rebase --onto master branch-base branch-head
Cherry-pick the changes in B since it diverged from A onto the current branch
git checkout base-branch
git cherry-pick A..B
Create a new branch with no parent
# Old and busted
git symbolic-ref HEAD refs/heads/branch-name
rm .git/index
git clean -fdx
# New hotness
git checkout --orphan i-am-lonely
Credential helpers:
# OS X
git config --global credential.helper osxkeychain
# Windows
# https://github.com/anurse/git-credential-winstore
# Just run it, it installed itself into %APPDATA%
# (But make sure you unblock the file first)
Open the origin URL in the browser (I sure hope it's HTTP...)
# OS X
git config --global --replace-all alias.home "\!open \"\$(git config remote.origin.url)\""
# Windows
# If you can get this incantation right without PowerShell, I'd love to see it
git config --global --replace-all alias.home "!powershell.exe -Command 'start $(git config remote.origin.url)'"
Fix the damn MAX_PATH 260 character limit on Windows
git config --global core.longpaths true
Some handy aliases
git config --global alias.lg "log --oneline --graph --decorate"
git config --global alias.ignored "ls-files -ci --exclude-standard"
# git assume $FILE -- never show the file as modified by "git status", "git add -A" and the like
# git unassume $FILE -- return the assumed file back to normal
# git assumed -- displays all files that are assumed unchanged
git config --global alias.assume "update-index --assume-unchanged"
git config --global alias.unassume "update-index --no-assume-unchanged"
git config --global alias.assumed "!git ls-files -v | grep '^h'"