Thread (1 message) 1 message, 1 author, 2016-06-15

Re: "git push" logic changed?

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:17

Greg KH [off-list ref] writes:
Well what should I do then to push to "orgin"?
...
Yes, but "git push origin" used to push my local changes there, and
that's all I really want.

Someone off-list told me I could edit my .git/branches/parent file to
fix this issue for that branch.  Since I hand-created that file in the
first place, that's not a bit deal.  But I was relying on git to get the
"origin" branch right, as I didn't edit it at all :)
If you cloned from "origin", then you would have gotton
something like:

	URL: that.machine:/this/directory.git
        Pull: master:origin

in your ".git/remotes/origin".  Since there are more downloaders
and individual developers than subsystem maintainers, this is a
good default for the former class of people.

You as the tree owner would then add "Push:" line(s) to push
back from your local repository.  For example:

	$ cat .git/remotes/origin	
	URL: that.machine:/this/directory.git
        Pull: master:origin
	Push: master:master

With this,

	$ git push origin

would push master branch to that.machine:/this/directory.git/
repository.  With --tags or --all:

	$ git push --tags origin
        $ git push --all origin

These "Push:" lines are for people who have write access to the
other side (which is a minority compared to downloaders), so git
does not create them by default when you clone the repository.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help