Git 中我仍然感到困惑的一种情况是:
$ git clone https://github.com/dude1/project
哎呀,这不是真正正确的版本。我会切换:
$ git remote add dude2 https://github.com/dude2/project
$ git fetch dude2
$ git checkout dude2/master
Note: checking out 'dude2/master'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b new_branch_name
HEAD is now at f3o845a...
人力资源管理系统。我想master
参考dude2/master。
$ git checkout -b master dude2/master
fatal: A branch named 'master' already exists.
没有删除整个目录并重新开始,我如何干净地切换存储库?