[英]git pull changes from remote repo keeping the changes in local file
我在本地项目目录中有一个修改后的文件htmlpage.html,我想从bitbucket的远程分支中提取对该文件的更改而不会影响我的本地文件更改
不必提交或创建新分支,只需确保(如我在此处所述 )具有:
git config --global pull.rebase true
git config --global rebase.autoStash true
从那里,任何git pull都会自动:
pull --rebase
)上重放本地提交来更新当前分支 htmlpage.html
另一种方法,我在这里详细介绍 :
git update-index --skip-worktree -- htmlpage.html
# to cancel it:
git update-index --no-skip-worktree -- htmlpage.html
在测试git pull
之前,请先保存文件的副本: htmlpage.html
应当保持不变。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.