public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Christoph Duelli <duelli@melosgmbh•de>
To: git@vger•kernel.org
Subject: git mv + git pull issue
Date: Fri, 06 Jun 2008 09:57:19 +0200	[thread overview]
Message-ID: <4848EDDF.7090906@melosgmbh.de> (raw)

"git mv" followed by a git pull (before commiting) the move, loses the 
"remove" part of the move. This can lead to dupes in the repository.


Consider the following steps:

# create a new repo with a file in it
mkdir gitmv
cd gitmv/
git init
touch afile
git add afile
git commit -a -m"first"

# clone it
cd ..
git clone gitmv/ gitmv-clone
cd gitmv-clone/
touch other
git add other
git commit -a -m"other"

cd ../gitmv
git mv afile newname
# do not commit
# now: afile is not in the directory anymore
# oh, I need those changes my colleague made...
git pull ../gitmv-clone/
# now: both(!) afile and newname are in the directory

If I commit now (and overlook this) I will have 2 copies of this file in 
my repository which is not usually what I want.


Suggestion:
+ if the file was not touched in the pulled commits, leave it (missing)
+ if it was touched: this should be a conflict

Best regards
-- 
Christoph Duelli

             reply	other threads:[~2008-06-06  8:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-06  7:57 Christoph Duelli [this message]
2008-06-06 15:40 ` git mv + git pull issue Johannes Schindelin
2008-06-09  8:45   ` Christoph Duelli

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=4848EDDF.7090906@melosgmbh.de \
    --to=duelli@melosgmbh$(echo .)de \
    --cc=git@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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