0

我厌倦了清理我的主仓库并做了一个

git rm -rf * 
git commit -m 't'
git push origin 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.
4

1 回答 1

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分支,分支一个新的本地masteroff timer_redis,然后用新分支强行覆盖origin的版本master

于 2012-08-06T13:21:32.647 回答