IntelliJ IDEA中的Git Stash vs Shelve [英] Git Stash vs Shelve in IntelliJ IDEA
问题描述
我不熟悉Git的shelve
方面.如果使用stash
搁置未完成的工作,那么什么是shelve
?你会用它做什么?
I am very unfamiliar with the shelve
aspect of Git. If stash
is used to put aside unfinished work what is shelve
then? What would you use it for?
例如在更新项目中(从VCS菜单中)
For example on Update Project (from VCS menu)
将获得一个(在IntelliJ IDEA 2019.2中)
one will get (in IntelliJ IDEA 2019.2)
推荐答案
git shelve
在Git中不存在.
git shelve
doesn't exist in Git.
仅 git stash
:
- 当您想记录工作目录和索引的当前状态,但又想回到干净的工作目录时.
- 这将保存您的本地修改,并还原工作目录以匹配HEAD提交.
您有一个2008年的旧项目 git搁置来隔离分支中的修改,但这不会如今不是很有用.
You had a 2008 old project git shelve to isolate modifications in a branch, but that wouldn't be very useful nowadays.
该功能 Intellij IDEA搁置对话框中所述. "搁置和搁置"未链接到一个VCS(版本控制系统工具),但仅用于IDE本身,用于将尚未提交的未决更改临时存储在更改列表中.
As documented in Intellij IDEA shelve dialog, the feature "shelving and unshelving" is not linked to a VCS (Version Control System tool) but to the IDE itself, to temporarily storing pending changes you have not committed yet in changelist.
请注意,自Git 2.13(2017年第二季度)以来,您现在也可以存储单个文件.
这篇关于IntelliJ IDEA中的Git Stash vs Shelve的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!