在使用 Git 作为工具的几周后,我现在正在努力弄清楚 GIT 的真正工作方式。于是我从简单的事情开始:
git checkout -b test origin/development` //Creating new local branch from development
Create new text file called test.txt
git add . //Set files that will be committed
git commit -m "this is a test" // Committing
接下来是我的疑问:
当我尝试推送操作时:
git push origin development
日志显示:一切都是最新的。
如果我尝试进行推送:
git push origin HEAD:development
它的工作方式符合预期。
在我的调研中,我发现 HEAD 意味着当前分支的名称。因此,如果是这样的话,对我来说就没有任何意义。
两者之间有什么区别?
git push origin development
并且
git push origin HEAD:development