* pushing to a remote branch that one does not own
@ 2011-01-19 18:16 iani
2011-01-19 19:25 ` Maaartin
2011-01-19 19:56 ` Alexey Shumkin
0 siblings, 2 replies; 4+ messages in thread
From: iani @ 2011-01-19 18:16 UTC (permalink / raw)
To: git
Hello,
I want to contribute via "push" to a branch which I have previously cloned
from a remote repository. There is a problem:
If i create a new commit on branch "master", which coincides with
origin/master, then I can push this commit simply with
git push
However, if i switch to a different branch of the repository which was
cloned, for example by doing:
git checkout origin/lilt
Then I get the message:
"You are in 'detached HEAD' state. You can look around, make experimental
... (etc)"
So I HAVE to create my own new branch based on the one downloaded in order
to start committing and pushing changes. My question is therefore:
Am I strictly limited to committing only on the master / origin/master
branched, and forced to make a new branch for every branch that I cloned
from the remote repo, or is there a way of making the heads of the remote
branches visible as local too?
Thanks,
Iannis Zannos
--
View this message in context: http://git.661346.n2.nabble.com/pushing-to-a-remote-branch-that-one-does-not-own-tp5940751p5940751.html
Sent from the git mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: pushing to a remote branch that one does not own
2011-01-19 18:16 pushing to a remote branch that one does not own iani
@ 2011-01-19 19:25 ` Maaartin
2011-01-19 22:28 ` iani
2011-01-19 19:56 ` Alexey Shumkin
1 sibling, 1 reply; 4+ messages in thread
From: Maaartin @ 2011-01-19 19:25 UTC (permalink / raw)
To: iani; +Cc: git
On 11-01-19 19:16, iani wrote:
>
> Hello,
> I want to contribute via "push" to a branch which I have previously cloned
> from a remote repository. There is a problem:
>
> If i create a new commit on branch "master", which coincides with
> origin/master, then I can push this commit simply with
> git push
> However, if i switch to a different branch of the repository which was
> cloned, for example by doing:
> git checkout origin/lilt
> Then I get the message:
> "You are in 'detached HEAD' state. You can look around, make experimental
> ... (etc)"
> So I HAVE to create my own new branch based on the one downloaded in order
> to start committing and pushing changes. My question is therefore:
>
> Am I strictly limited to committing only on the master / origin/master
AFAIK, there's nothing special about origin, except that it's already
set up to track origin/master.
You can't commit to origin/lilt just like you can't commit to
origin/master. Those remote branches are there to mirror corresponding
branches in the remote repo, so you can do things like
git diff master origin/master
> branched, and forced to make a new branch for every branch that I cloned
> from the remote repo, or is there a way of making the heads of the remote
> branches visible as local too?
AFAIK, using
git branch lilt origin/lilt
you create a local branch tracking the remote one. Then you can work
with it just like you work with master. You may want to have a look at
.git/config for [branch <branchname>] sections or not. I'm quite a
newbie, but this works for me.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: pushing to a remote branch that one does not own
2011-01-19 18:16 pushing to a remote branch that one does not own iani
2011-01-19 19:25 ` Maaartin
@ 2011-01-19 19:56 ` Alexey Shumkin
1 sibling, 0 replies; 4+ messages in thread
From: Alexey Shumkin @ 2011-01-19 19:56 UTC (permalink / raw)
To: git
> Am I strictly limited to committing only on the master / origin/master
> branched, and forced to make a new branch for every branch that I cloned
> from the remote repo, or is there a way of making the heads of the remote
> branches visible as local too?
>
> Thanks,
>
> Iannis Zannos
>
Maybe you should read "Pro Git" book chapter 3 "Git Branching"
http://progit.org/book/ch3-0.html
(and look forward for chapter 3.5 "Remote Branches")?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: pushing to a remote branch that one does not own
2011-01-19 19:25 ` Maaartin
@ 2011-01-19 22:28 ` iani
0 siblings, 0 replies; 4+ messages in thread
From: iani @ 2011-01-19 22:28 UTC (permalink / raw)
To: git
Thanks a lot for the prompt answer. Following your advice I read the progit
online chapter about branches and it explained to me about git branch lilt
origin/lilt as Maaartin explains. So I am testing it now.
Thanks
Iannis Z.
--
View this message in context: http://git.661346.n2.nabble.com/pushing-to-a-remote-branch-that-one-does-not-own-tp5940751p5941621.html
Sent from the git mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-01-19 22:28 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-19 18:16 pushing to a remote branch that one does not own iani
2011-01-19 19:25 ` Maaartin
2011-01-19 22:28 ` iani
2011-01-19 19:56 ` Alexey Shumkin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).