gerrit - Different branch definitions for git push -


what difference between:

git push origin head:refs/for/master

and

git push origin refs/for/master

shouldn't second command push changes remote repo origin , move head?

'refspec' option following 'repository' name.

according --help page refspec in form of

<source ref>:<destination ref> 

refs name of branch , means use 'source ref' update 'destination ref'.
so

git push origin head:refs/for/master 

means update remote master using head(current branch)

can omit 'destination ref' part. if git tries find remote branch name same 'source ref'.
so

git push origin refs/for/master 

means using local 'refs/for/master' branch update remote 'refs/for/master' branch.

/for/ used gerrit not local repository. git can't find local 'refs/for/master' branch , can't anything.


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -