[ACCEPTED]-How can I push a specific branch of Git to my server?-git

Accepted answer
Score: 76

You would simply do:

git push origin webfaction_customized

Where origin is your 3 remote name and webfaction_customized is 2 your custom branch.

Hence, when you work 1 on the master branch, you are pushing via:

git push origin master
Score: 4

You would simply do:

git push origin localBranchName:remoteBranchName

0

Score: 1

The message Warning: Remote HEAD refers to nonexistent ref, unable to checkout. only tells you that the HEAD 7 link does not exist and thus Git does not 6 know which revision to check out to your 5 local working directory.

Chances are that 4 the branches on production_server themselves are created 3 correctly. Just do a git checkout <whatever-branch-you-want> and start hacking 2 away.

If it doesn't solve the issue, paste 1 here the output of git branch -a and cat .git/config run n both repos.

Score: 0

Your push-command seems right, assuming 3 webfaction_server is the name of a remote and not just the server 2 address. Run git help remote to learn more about pushing 1 and pulling to/from multiple remotes.

Score: 0

you may need to update the server information 10 with git-update-server-info. This tool will update the HEAD information 9 on the server with the recent commit hashes, updating 8 old branches and making new branches visible. In 7 particular, it will update the info/refs file in 6 your git repository. You will need to run 5 this on the server, so, perhaps something 4 like the following could be useful:

ssh webserver "cd /path/to/your/repository.git/ && git-update-server-info"

It might 3 be possible to trigger that update, possibly 2 with a post-commit hook, but have not tried 1 that yet.

More Related questions