将未跟踪目录合并到跟踪的目录中 [英] Merge an untracked directory into the tracked directory
本文介绍了将未跟踪目录合并到跟踪的目录中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有两个版本的源目录,其中
/ d1
被git跟踪但过期
/ d2
不会被任何东西跟踪,只会被最新的
将 / d2
合并为 / d1
?
解决方案
在d1上复制d2然后创建一个新的提交对象是什么意思?
只是确保你不覆盖你的 .git
-directory。做备份是一个很好的练习。
cp -aT d2 d1
git status
#显示大量更改文件
git add -u#或git add -A取决于您是否要添加新文件以及
git commit -m从我未跟踪的目录中提交了很多更改我想知道为什么首先解决了问题?
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-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?"
这篇关于将未跟踪目录合并到跟踪的目录中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文