美文网首页
使用Git与Github交互 - push和clone

使用Git与Github交互 - push和clone

作者: CappuccinoBx | 来源:发表于2016-11-29 16:48 被阅读0次

从Github上clone一个分支(Google sample):

git clone https://github.com/googlesamples/android-architecture.git
git branch -a //列出所有分支
git checkout -b local-branch-name origin/todo-mvp //-b后面的参数是你将远程分支拉倒本地的本地分支名.后面的参数就是git branch -a 列出的远程分支的分支名

如果要push到远程仓库

git remote add origin git@github.com:yourId/yourRepository
git push -u origin

注意由于众所周知的墙,所以你很可能无法push,会提示你Timeout。一个简单的方法就是弄个http的代理

git config --global http.proxy ip:port
git config --global https.proxy ip:port

最后再

git push -u origin

将本地的origin远程分支push上去

相关文章

网友评论

      本文标题:使用Git与Github交互 - push和clone

      本文链接:https://www.haomeiwen.com/subject/mjtzpttx.html