开发者

Merge an untracked directory into the tracked directory

开发者 https://www.devze.com 2023-02-11 10:09 出处:网络
I have two version of the source directories where /d1 is tracked by git but outdated /d2 is not tracked by anything but the most up-to开发者_如何学JAVA-date

I have two version of the source directories where

/d1 is tracked by git but outdated

/d2 is not tracked by anything but the most up-to开发者_如何学JAVA-date

What is the best way to merge /d2 into /d1?


what speaks against copying d2 over d1 and then creating a new commit objects? just make sure you do not overwrite your .git-directory. doing backups is a good exercise here

cp -aT d2 d1
git status
# shows lots of changed files
git add -u # or git add -A depending if you want to add new files as well
git commit -m "committing a whole lot of changes from my untracked directory. i wonder why it got untracked in the first place?"
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号