Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
有没有像git switch/checkout这样的东西——我们的?_Git - Fatal编程技术网

有没有像git switch/checkout这样的东西——我们的?

有没有像git switch/checkout这样的东西——我们的?,git,Git,我的文件存在于分支target中,并且以当前状态暂存。其中一些文件具有相同的名称,但不同。我可以用一个简单的命令切换到branchtarget,始终获取当前状态的版本吗?(“我们的”) git checkout——我们的不适用于分支切换git开关没有——我们的。当然可以 git stash git checkout target git checkout stash -- . git stash pop 但是有没有更简单的方法呢?我认为没有这样的命令,但是你有没有考虑过制作一个这样的脚本?它会

我的文件存在于分支
target
中,并且以当前状态暂存。其中一些文件具有相同的名称,但不同。我可以用一个简单的命令切换到branch
target
,始终获取当前状态的版本吗?(“我们的”)

git checkout——我们的
不适用于分支切换
git开关
没有
——我们的
。当然可以

git stash
git checkout target
git checkout stash -- .
git stash pop

但是有没有更简单的方法呢?

我认为没有这样的命令,但是你有没有考虑过制作一个这样的脚本?它会自动为您使用这些命令。