Skip to content

Instantly share code, notes, and snippets.

@kastiglione
Created September 17, 2019 16:53
Show Gist options
  • Save kastiglione/a401678a37e709e4a3c3557366edaa1d to your computer and use it in GitHub Desktop.
Save kastiglione/a401678a37e709e4a3c3557366edaa1d to your computer and use it in GitHub Desktop.
git fetch config
addbranch() {
local branch=$1
git config --add remote.origin.fetch "+refs/heads/${branch}:refs/remotes/origin/${branch}"
git fetch
git checkout "$branch"
}
# My prefix is dl/
git config remote.origin.fetch "+refs/heads/master:refs/remotes/origin/master"
git config --add remote.origin.fetch "+refs/heads/dl/*:refs/remotes/origin/dl/*"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment