本文共 1280 字,大约阅读时间需要 4 分钟。
$ git branch -a* master remotes/origin/HEAD -> origin/master remotes/origin/master
$ git branch* master
$ git branch test$ git branch* master test
$ git push origin testTotal 0 (delta 0), reused 0 (delta 0)To https://git.xxx.xxx/xxx/xxx.git * [new branch] test -> test
$ git checkout testSwitched to branch 'test'$ git branch master* test
$ git checkout masterSwitched to branch 'master'Your branch is up-to-date with 'origin/master'.$ git branch -d testDeleted branch test (was aaadfcd).
git branch -a* master remotes/origin/HEAD -> origin/master remotes/origin/master remotes/origin/test
在clone完成之后,Git 会自动为你将此远程仓库命名为origin(origin只相当于一个别名,运行git remote –v或者查看.git/config可以看到origin的含义),并下载其中所有的数据,建立一个指向它的master 分支的指针,我们用(远程仓库名)/(分支名) 这样的形式表示远程分支,所以origin/master指向的是一个remote branch(从那个branch我们clone数据到本地)
执行 git remote -v 的结果,看出来origin其实就是远程的git地址的一个别名。
$ git remote -vorigin https://xxx.xxx.xxx/xxx/xxx.git (fetch)origin https://xxx.xxx.xxx/xxx/xxx.git (push)
git push origin :testTo https://xxx.xxx.net/xxx/xxx.git - [deleted] test$ git branch -a* master remotes/origin/HEAD -> origin/master remotes/origin/master本文转自我爱物联网博客园博客,原文链接:http://www.cnblogs.com/yydcdut/p/4690864.html,如需转载请自行联系原作者