git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Francis Moreau <francis.moro@gmail.com>
To: git@vger.kernel.org
Subject: question about a merge result
Date: Thu, 30 Apr 2009 14:21:07 +0200	[thread overview]
Message-ID: <38b2ab8a0904300521m9e31867j7848135acfae0faa@mail.gmail.com> (raw)

Hello,

I'm a little bit confused about a merge I have done and the result
suprised me. Thinking about it I'm still not convinced what should be
the result.

Here's the use case:

$ mkdir test-git && cd test-git
$ date > A
$ date > B
$ git init
$ git add .
$ git commit -m "Init"

So far I just created a repo with 2 files A and B

$ git branch b1
$ git rm B
$ git commit -m "remove B"

Now I created a branch 'b1' and remove B file in master branch

$ git checkout b1
$ git rm B
$ git commit -m "remove B"
$ git revert HEAD

Now on 'b1' I did the same as master but I thought that removing B was
a bad idea so I revert the previous commit

$ git checkout master
$ git pull . b1
$ ls B
ls: cannot access B: No such file or directory

So merging 'b1' into master removed the B file even if in branch 'b1'
I restored it.

Could anybody explain me why this is the correct behaviour and why not
file 'B' is not restored as it was done in branch 'b1' ?

thanks
-- 
Francis

             reply	other threads:[~2009-04-30 12:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-30 12:21 Francis Moreau [this message]
2009-04-30 12:34 ` question about a merge result Michael Gaber
2009-04-30 14:26   ` Jeff King
2009-04-30 15:05     ` Francis Moreau
2009-04-30 15:39       ` Björn Steinbrink
2009-04-30 15:42       ` Jeff King
2009-05-01 16:27       ` Daniel Barkalow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=38b2ab8a0904300521m9e31867j7848135acfae0faa@mail.gmail.com \
    --to=francis.moro@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).