2012-08-06 96 views
0

我累了清理我的主人回購,做了的Git和Git合併--no-FF timer_redis

git rm -rf * 
git commit -m 't' 
git push origin master 

然後我試着做從主分支下面。

git merge --no-ff timer_redis 

根據以下錯誤消息,我該從哪裏開始?這是爲什麼發生?我只是想要將一個repo timer_redis移到master上。

[email protected]:~/workspace/Amazon-Products-Crawler-1$ git merge --no-ff timer_redis 
CONFLICT (delete/modify): LaunchCrawler.py deleted in HEAD and modified in timer_redis. Version timer_redis of LaunchCrawler.py left in tree. 
CONFLICT (delete/modify): config_files/config.txt deleted in HEAD and modified in timer_redis. Version timer_redis of config_files/config.txt left in tree. 
CONFLICT (delete/modify): config_files/default.json deleted in HEAD and modified in timer_redis. Version timer_redis of config_files/default.json left in tree. 
CONFLICT (delete/modify): config_files/proxy_list.txt deleted in HEAD and modified in timer_redis. Version timer_redis of config_files/proxy_list.txt left in tree. 
CONFLICT (delete/modify): config_files/ubuntu_install.sh deleted in HEAD and modified in timer_redis. Version timer_redis of config_files/ubuntu_install.sh left in tree. 
CONFLICT (delete/modify): debugasin.txt.log deleted in HEAD and modified in timer_redis. Version timer_redis of debugasin.txt.log left in tree. 
CONFLICT (delete/modify): ec2_shutdown_monitor.py deleted in HEAD and modified in timer_redis. Version timer_redis of ec2_shutdown_monitor.py left in tree. 
CONFLICT (delete/modify): getPageParser.py deleted in HEAD and modified in timer_redis. Version timer_redis of getPageParser.py left in tree. 
CONFLICT (delete/modify): includes/utility.py deleted in HEAD and modified in timer_redis. Version timer_redis of includes/utility.py left in tree. 
CONFLICT (delete/modify): temp_tables/error404_core_1.txt deleted in HEAD and modified in timer_redis. Version timer_redis of temp_tables/error404_core_1.txt left in tree. 
CONFLICT (delete/modify): temp_tables/error_core_1.txt deleted in HEAD and modified in timer_redis. Version timer_redis of temp_tables/error_core_1.txt left in tree. 
CONFLICT (delete/modify): temp_tables/redo_core_1.txt deleted in HEAD and modified in timer_redis. Version timer_redis of temp_tables/redo_core_1.txt left in tree. 
CONFLICT (delete/modify): threaded_crawl.py deleted in HEAD and modified in timer_redis. Version timer_redis of threaded_crawl.py left in tree. 
Automatic merge failed; fix conflicts and then commit the result. 

回答

1

我認爲你是混亂的「倉庫」和「分支」。您使用git rm -rf *git commit -m 't'所完成的操作將清除master分支中的每個文件。然後,您將該版本控制的更改推送到您的origin存儲庫。

timer_redis分支包含你所刪除的文件,所以當你把它合併中,它拋出對存在於timer_redis這也在timer_redis修改的任何文件中的合併衝突。

沒有工作流程我可以想到你會在哪裏發佈git rm -rf *,然後繼續使用該分支歷史記錄。如果你想master樣子timer_redis(又不想不timer_redis存在於master但是任何的變化)試試這個:

git checkout timer_redis 
git branch -D master 
git checkout -B master timer_redis 
git push -f origin master 

這將刪除您當地的master分支,分支新的本地master關閉timer_redis ,然後用新分支強制覆蓋originmaster版本。

+0

不是刪除('git branch -D')並重新創建'master'分支,而是在'master'上可以選擇'git reset --hard timer_redis'。 – 2012-08-06 13:36:25

+0

git reset --hard timer_redis - 這也工作。感謝所有的清理 – Tampa 2012-08-06 14:06:17