有人将一个名为testwith 的分支推git push origin test送到共享存储库.我可以看到分支git branch -r.
现在我正试图检查远程test分支.
我试过了:
git checkout test 什么都不做
git checkout origin/test给* (no branch).这令人困惑.我怎么能在"没有分支"?
如何查看远程Git分支?
git checkout 'another_branch'
Run Code Online (Sandbox Code Playgroud)
要么
git checkout origin 'another_branch'
Run Code Online (Sandbox Code Playgroud)
要么
git checkout origin/'another_branch'
Run Code Online (Sandbox Code Playgroud)
众所周知,git checkout is a very overloaded command. And I do understand that certain commands got introduced to distribute, e.g. to git switch.
在我使用以下命令之前:
$ git checkout <existing-branch>
$ git checkout <hash>
$ git checkout -b <new-branch-name>
Run Code Online (Sandbox Code Playgroud)
所以我想知道git switch介绍后,剩下的目的是什么git-checkout?这是一个已弃用的命令吗?
为什么git命令要切换名为git checkout?的分支?
它真的有意义吗?
我会改名git switch.此外,git checkout还有其他含义:例如还原文件(如svn revert)
我git checkout -- .做错了。
既未提交也未隐藏的更改。.它们是检索我的更改的方法吗?
尝试的git reflog更改未反映在其中。
如果我提交或隐藏我知道要检索,但不做任何结帐又如何呢?
我所做的事情
git status
在我发现一些无用的更改后,我尝试进行checkout更改,git checkout -- .
所以有可能找回吗?