我厌倦了清理我的主回购并做了一个
git rm -rf *
git commit -m 't'
git push origin master
然后我尝试从master分支执行以下操作。
git merge --no-ff timer_redis
根据以下错误消息,我从哪里开始?为什么会这样?我只是想将repo timer_redis移动到master。
ubuntu@ubuntu:~/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.
答案 0 :(得分:1)
我认为你混淆了'存储库'和'分支'。您使用git rm -rf *
和git commit -m 't'
完成的工作将清除master
分支中的每个文件。然后,您将(版本控制的更改)推送到origin
存储库。
timer_redis
分支包含您删除的所有文件,因此当您将其合并时,会在timer_redis
中存在的任何文件中引发合并冲突,该文件也在timer_redis
中进行了修改
我无法想到您在哪里发布git rm -rf *
然后继续使用该分支历史记录的工作流程。如果您希望master
看起来像timer_redis
(并且不希望master
而不是timer_redis
中存在任何更改),请尝试以下操作:
git checkout timer_redis
git branch -D master
git checkout -B master timer_redis
git push -f origin master
这将删除您本地的master
分支,将新的本地master
分支到timer_redis
,然后强行覆盖origin
的{{1}}版本master
新分支。