I am working in a system that automatically git clones using the --branch arg like so:
git clone --branch master --depth 50 [email protected]:Something/Cool.git ~/Cool
And I would now like to push to another branch. I can't figure out how to track the remote since git fetch and git pull don't seem to be able to access them.
I ended up modifying the config for each branch (or branch glob) I want to fetch. Expressed as an 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"'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With