tags:

views:

52

answers:

1

In this post, I found out that it was possible to create individual mappings for branch names so that pushing back to a central repository can be permanently mapped to a subtree, like:

  • git master branch name: foo
  • remote branch name: foo
  • git push origin foo on slave1 does the equivalent of git push origin foo:refs/slave1/foo

But the post implied that it's not possible to do this on an automatic basis, e.g. specifying a wildcard map from refs/heads/* on the remote to refs/slave1/* on the master.

Well, is it possible?

I clone my repository in a ton of places, make changes on my devbox, and fetch those changes to the copy on the development server for testing. I end up making changes on the dev server and wanting to push them back, but I can't push it with the same branch name because I have that branch checked out on the master. It would be nice to just configure the clone once to be smart about it.

If it's not possible, this is a feature request and I'm pasting this URL to the git mailing list :)

A: 

I found the answer myself.

git config --add remote.origin.push +refs/heads/*:refs/MACHINENAME/*

Josh K