作者:小虾米 发表时间:2017-06-13 15:19:43 类别:PHP
[~] git clone [url] [file_path]
[~] git remote -v
//origin https://domain/git_name.git (fetch)
//origin https://domain/git_name.git (push)
//增加一个新的远程仓库
//git remote add [short_name] [url]
[~] git remote add another name@file/path/another_git_name.git
#再次查看远程仓库,会显示增加的仓库地址
//another name@file/path/another_git_name.git (fetch)
//another name@file/path/another_git_name.git (push)
//origin https://domain/git_name.git (fetch)
//origin https://domain/git_name.git (push)
//推荐两种方式
//1、修改命令
[~] git remote set-url origin [url]
//2、先删除,再添加
[~] git remote rm origin
[~] git remote add origin [url]
//拉取或推送指定的仓库
//git push/pull [short_name] [branch]
[~] git push origin master //推送至origin仓库的master主分支
[~] git pull another test //推送至another仓库的test分支
git rm -r --cached .
git add .
git commit -m 'update .gitignore'