car*_*era 1 git atlassian-sourcetree
我想结帐一个分支,我收到了这条消息
error: Your local changes to the following files would be overwritten by checkout:
src/main/webapp/data/GuerrillaLabels.json
Please, commit your changes or stash them before you can switch branches.
Aborting
Run Code Online (Sandbox Code Playgroud)
但我希望这些文件被覆盖
https://git-scm.com/docs/git-checkout#git-checkout---force
您可以通过-f(force) 标志强制签出分支,这将清除您所做但尚未提交的任何更改。
git checkout -f branch
Run Code Online (Sandbox Code Playgroud)
如果您不想丢失所有更改,可以专门使用以下命令签出文件:
git checkout -- src/main/webapp/data/GuerrillaLabels.json
Run Code Online (Sandbox Code Playgroud)
https://git-scm.com/book/en/v1/Git-Tools-Stashing
您还可以隐藏您所做的更改并在以后重新应用它们
git stash
Run Code Online (Sandbox Code Playgroud)
你可以查看你的藏品
git stash list
Run Code Online (Sandbox Code Playgroud)
您可以使用pop. 不传递任何内容pop将应用最后一个隐藏的项目。
git stash pop
Run Code Online (Sandbox Code Playgroud)
注意:这种方法可能会导致与代码冲突。
| 归档时间: |
|
| 查看次数: |
5812 次 |
| 最近记录: |