public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
* git mv + git pull issue
@ 2008-06-06  7:57 Christoph Duelli
  2008-06-06 15:40 ` Johannes Schindelin
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Duelli @ 2008-06-06  7:57 UTC (permalink / raw)
  To: git

"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

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

end of thread, other threads:[~2008-06-09  8:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-06  7:57 git mv + git pull issue Christoph Duelli
2008-06-06 15:40 ` Johannes Schindelin
2008-06-09  8:45   ` Christoph Duelli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox