Making a push prefix for git

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

  • git master server name: foo
  • remote branch name: foo
  • git push origin foo

    on slave1 does the equivalent git push origin foo:refs/slave1/foo

But the mail implied that this could not be done automatically, for example. specifying a lookup map from refs / heads / * on the remote to refs / slave1 / * on the master server.

Well, is it possible?

I clone my repository in tons of places, make changes to my devbox and pull those changes into a copy on the development server for testing. I end up committing changes to the dev server and want to push them back, but I cannot push to it with the same branch name because I checked out that branch on the master server. It would be nice to just set up a clone once to be smart.

If this is not possible, this is a feature request and I paste this url into the git mailing list :)

+2


a source to share


1 answer


I found the answer myself.



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

+1


a source







All Articles