Git Git pull 强制覆盖本地文件,命令是什么啊?

xufeng · April 09, 2012 · Last by honwhy replied at April 25, 2017 · 74016 hits

每次运行 Bundle 都会生成 Gemfile.lock

git pull error: Your local changes to 'Gemfile.lock' would be overwritten by merge. Aborting.

execute git help pull the press /force

git checkout -f Gemfile.lock

pull 下来有 diff 的话再强制 checkout 下

git pull -Xtheirs

用法有问题,Gemfile.lock 变更了就 commit 进去阿

可以 先 rm 掉 Gemfile.lock , 生成的文件 不建议放进 版本控制

Gemfile.lock 要版本控制的,但是 Gemfile 要写细点

@xufeng git pull [origin-name] [branch-name] --ff(这个太暴利了。。一般别人都不会改 Gemfile.lock 的吧,而且我记得 git pull 是 merge 留下 confict 的,不会直接 abort 吧)

git fetch --all  
git reset --hard origin/master 
Reply to honwhy

你理解错意思了。。被你坑死。。

Reply to Leotw

你应该 gitignore 这个 lock 文件,哈

You need to Sign in before reply, if you don't have an account, please Sign up first.