Git 同一文件被多人修改了文件名该如何处理

用户一修改了文件名,并推送到了远端。用户二也修改了文件名,在进行推送时,就会被拒绝。

拉取最新代码后发现有相同的文件,只是文件名不同。index1.htmindex2.htm两个文件内容是完全相同的。

查看当前状态,可知有其他想把文件名修改为index2.htm。此时只需要根据提示,删除index.htm。协商后决定保留哪一个文件,比如我们决定保留index1.htm。那么删除index2.htm

最后在commit一次,即可顺利推送。

Git-git pull 与 git pull --rebase 的区别 Git 他人同时修改了文件名和文件内容该如何处理
You need to set install_url to use ShareThis. Please set it in _config.yml.

评论

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×