大佬教程收集整理的这篇文章主要介绍了Git 系列教程(8)- 远程仓库的使用,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
git remote
命令,它会列出你指定的每一个远程服务器的名称$ git clone https://github.com/schacon/ticgit @R_579_1419@ into 'ticgit'... remote: Reusing exisTing pack: 1857,done. remote: @R_125_10586@l 1857 (delta 0),reused 0 (delta 0) Receiving objects: 100% (1857/1857),374.35 KiB | 268.00 KiB/s,1)">. Resolving deltas: 772/772),1)">. checking connectivity... . $ cd ticgit $ git remote origin
会显示需要读写远程仓库使用的 Git 的 URL和名称(origin)
git remote -v origin https:github.com/schacon/ticgit (fetch) origin https:github.com/schacon/ticgit (push)
$ cd grit $ git remote -v bakkdoor https:github.com/bakkdoor/grit (fetch) bakkdoor https:github.com/bakkdoor/grit (push) cho45 https:github.com/cho45/grit (fetch) cho45 https:github.com/cho45/grit (push) defunkt https:github.com/defunkt/grit (fetch) defunkt https:github.com/defunkt/grit (push) koke git:github.com/koke/grit.git (fetch) koke git:github.com/koke/grit.git (push) origin git@github.com:mojombo/grit.git (fetch) origin git@github.com:mojombo/grit.git (push)
git remote add <shortname> <url>
polo@B-J5D1MD6R-2312 watermarker % git remote -v origin git@gitee.com:poloyy/watermarker.git (fetch) origin git@gitee.com:poloyy/watermarker.git (push) polo@B-J5D1MD6R-2312 watermarker % git remote add test git@gitee.com:testyy/waterm arker.git polo@B-J5D1MD6R-watermarker.git (push) test git@gitee.com:testyy/watermarker.git (fetch) test git@gitee.com:testyy/watermarker.git (push)
可以使用 test
来代替整个 URL
从远程仓库中获得数据,可以执行
git fetch <remote>
git push <remote> <branch>
git remote show <remote>
可以查看远程仓库的更多信息
% git remote show origin * 远程 origin 获取地址:git@gitee.com:poloyy/watermarker.git 推送地址:git@gitee.com:poloyy/watermarker.git HEAD 分支:master 远程分支: master 已跟踪 为 git pull 配置的本地分支: master 与远程 master 合并 为 git push 配置的本地引用: master 推送至 master (可快进)
$ git remote show origin * remote origin URL: https:github.com/my-org/complex-project Fetch URL: https:github.com/my-org/complex-project Push URL: https:github.com/my-org/complex-project HEAD branch: master Remote branches: master tracked dev-branch tracked markdown-Strip tracked issue-43 new (next fetch will store in remotes/origin) issue-45 new (next fetch will store origin) refs/remotes/origin/issue-11 stale (use git remote prune to removE) Local branches configured for : dev-branch merges with remote dev-branch master merges with remote master Local refs configured : dev-branch pushes to dev-branch (up to date) markdown-Strip pushes to markdown-Strip (up to ) master pushes to master (up to date)
包含多个分支的信息
git remote rename <old> <new>
以上是大佬教程为你收集整理的Git 系列教程(8)- 远程仓库的使用全部内容,希望文章能够帮你解决Git 系列教程(8)- 远程仓库的使用所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。