github - How to git fetch another branch after cloning a single branch -
i working in system automatically git clones using --branch arg so:
git clone --branch master --depth 50 git@github.com:something/cool.git ~/cool
and push branch. can't figure out how track remote since git fetch , git pull don't seem able access them.
i ended modifying config each branch (or branch glob) want fetch. expressed alias:
[alias] # usage: git add-fetch-branch remote branch add-fetch-branch = !sh -c 'git config --add remote.$0.fetch "refs/heads/$1:refs/remotes/$0/$1"'
Comments
Post a Comment