如何在 Github 桌面版中 'Git stash'?
How do I 'Git stash' in Github Desktop?
由于涉及 SSH 的一些奇怪问题(我也是 git 的新手)我无法通过命令行为 git 项目做出贡献,所以不得不使用 GUI Github桌面。
一切都很顺利,直到我的同事在一夜之间做出了一些改变。由于与我的本地文件冲突(大约有 30 个文件已更新),我无法将它们拉到我的本地。
如何在 Github Desktop 中用他的更改简单地覆盖我所有的本地文件?
您所要做的就是删除您的分支并重新获取您想要的分支。这样他的所有更改都会进入您的分支。但是,如果您还有一些不想删除的更改,那么您可以创建一个新分支并将该分支合并到您的分支中。
按照以下步骤操作:
1. 从当前分支创建一个新分支。
2.结帐到新分支并删除旧分支。
3. 拉出远程分支。
4. Cherry 从新分支中挑选所有有效提交。
谢谢
您需要 GitHub Desktop V2.0.0,现在(2019 年 6 月)支持 stashing。
见desktop/desktop
issue 6107, and its design
I imagine this is someone working on a feature branch who wants to move to master
, and wants their changes to stay on the feature
branch.
- Users will only (at least at first) create stashes when switching branches.
- We'll prompt them with a modal asking what they want to do with their uncommitted changes.
- If they want their changes to stay, we'll create a stash for them.
- When they return to that branch, they'll be able to click into and see their stash, clear and apply/pop it.
- This also encourages the current default behavior of taking uncommitted changes with you to a new branch
由于涉及 SSH 的一些奇怪问题(我也是 git 的新手)我无法通过命令行为 git 项目做出贡献,所以不得不使用 GUI Github桌面。
一切都很顺利,直到我的同事在一夜之间做出了一些改变。由于与我的本地文件冲突(大约有 30 个文件已更新),我无法将它们拉到我的本地。
如何在 Github Desktop 中用他的更改简单地覆盖我所有的本地文件?
您所要做的就是删除您的分支并重新获取您想要的分支。这样他的所有更改都会进入您的分支。但是,如果您还有一些不想删除的更改,那么您可以创建一个新分支并将该分支合并到您的分支中。
按照以下步骤操作:
1. 从当前分支创建一个新分支。
2.结帐到新分支并删除旧分支。
3. 拉出远程分支。
4. Cherry 从新分支中挑选所有有效提交。
谢谢
您需要 GitHub Desktop V2.0.0,现在(2019 年 6 月)支持 stashing。
见desktop/desktop
issue 6107, and its design
I imagine this is someone working on a feature branch who wants to move to
master
, and wants their changes to stay on thefeature
branch.
- Users will only (at least at first) create stashes when switching branches.
- We'll prompt them with a modal asking what they want to do with their uncommitted changes.
- If they want their changes to stay, we'll create a stash for them.
- When they return to that branch, they'll be able to click into and see their stash, clear and apply/pop it.
- This also encourages the current default behavior of taking uncommitted changes with you to a new branch