查看远程库
$ git remote -v origin https://github.com/autoliuweijie/MachineLearning.git (fetch) origin https://github.com/autoliuweijie/MachineLearning.git (push)
删除远程库
$ git remote remove [remote_name]
例:
$ git remote remove origin
添加远程库
$ git remote add [SSH URL or HTTP URL]
例:
$ git remote add origin git@github.com:autoliuweijie/DeepLearning.git
注意,如果用HTTP URL,以后每次push的时候都要输入github的帐号密码,如果用SSH URL,必须在远程库上添加本机的SSH公钥;
将branch与远程库
$ git push -u [remote_name] [branch_name]
例:
$ git push -u origin master