1

I just set up an Azure website and am trying to push with git from an existing repository. So I ran

git push azure master

and things sort of worked. A lot of files got pushed, but I think they came from origin master, whereas I would like to push changes from the branch I'm working on origin web-zach. Since I'm not sure how Azure works, I would like to push to the azure master branch and not the azure web-zach branch.

I'm wondering if there's a simple command I'm missing here? Something maybe like (this is certainly wrong)

git push azure master --otherBranch origin web-zach

I'm also not sure if I'm experiencing expected behavior here or if Azure (and Node/Kudu) are messing something up. git push azure master also seems to run some deployment scripts, so it does seem a little weird.

4

2 回答 2

1

The command is

git push azure web-zach:refs/heads/master

For a little more explanation, a search for "refspec" (from magikid's git man page) uncovered some good articles: http://blog.endpoint.com/2008/07/git-push-know-your-refspecs.html The default behavior of git push remote_repo some_branch

automatically pushes the local branch named some_branch to the remote branch of the same name. To specify the name of the remote repository I used

git push remote_repo local_branch:refs/heads/remote_branch

I also got my default "git push azure" command to run the above by changing my .git/config file. Under [remote "azure"] I added:

push = refs/heads/web-zach:refs/remotes/azure/master
于 2014-09-09T14:33:47.997 回答
0

The syntax for the git push command is well documented https://www.kernel.org/pub/software/scm/git/docs/git-push.html

You are pushing your master branch to azure. If you want to push a different branch git push azure <branchname>

于 2014-09-08T23:46:24.640 回答