git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* pushing changes to a remote branch
@ 2007-07-10 14:36 martin f krafft
  2007-07-10 17:34 ` Jeff King
  2007-07-11 19:29 ` Jan Hudec
  0 siblings, 2 replies; 10+ messages in thread
From: martin f krafft @ 2007-07-10 14:36 UTC (permalink / raw)
  To: git discussion list

[-- Attachment #1: Type: text/plain, Size: 1898 bytes --]

Hi list,

I am using git-remote to clone a remote repository and track only
a select number of branches:

  git remote add -f -t vim -t ssh origin git://git.server.org/path/to/repo.git
  git branch -r
    origin/ssh
    origin/vim
  git merge ...

I now merge these into the local repo and decide that I need to make
a change to origin/vim. So I figure that it's probably easiest if
I just checkout the remote branch, make the change, commit it, push
it, return to the master branch, git-remote update and merge, but:

  git checkout origin/vim
    Note: moving to "origin/vim" which isn't a local branch
  echo change > newfile; git add newfile
  git commit -m'make change'
    Created commit 64b8b2e: make change
     1 files changed, 1 insertions(+), 0 deletions(-)
      create mode 100644 newfile
  
If I now checkout master and then return to origin/vim, the commit
is gone.

If I repeat all this and, instead of returning to master, I push the
commit to origin, git suggests success (the push looks normal).
However, I then cannot find the commit anymore. It's not available
locally, nor in origin/vim, nor in the local master branch or in
origin/master.

This is curious and I'd love to find out what's going on.

Much more, however, I am interested how I am supposed to push
commits back to select remote branches.

Using

  git push git://git.server.org/path/to/repo.git \
    7fbb0655:refs/heads/vim

does push commit 7fbb0655 to the vim branch in the remote
repository, but I should be able to do this using origin/vim, no?
How?

-- 
martin;              (greetings from the heart of the sun.)
  \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck
 
spamtraps: madduck.bogus@madduck.net
 
"the worst part of being old is remembering when you was young."
                                -- alvin straight (the straight story)

[-- Attachment #2: Digital signature (GPG/PGP) --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-07-14  8:43 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-10 14:36 pushing changes to a remote branch martin f krafft
2007-07-10 17:34 ` Jeff King
2007-07-10 18:10   ` Brian Gernhardt
2007-07-10 22:04     ` Jeff King
2007-07-11  3:44     ` Sean Kelley
2007-07-11 19:34       ` Jan Hudec
2007-07-11 19:31     ` Jan Hudec
2007-07-11 21:26       ` Junio C Hamano
2007-07-14  8:38         ` Jan Hudec
2007-07-11 19:29 ` Jan Hudec

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).