GIT代码管理: git remote add
2023-05-20 11:28
git
156
0
0
0
标题录入
封面图
git remote 命令用于在远程仓库的操作 ``` git init //初始化一个git的本地仓库 git add README.md git commit -m “first commit” git remote add dev your_git_address git push dev master git remote add test your_test_git_address //将第二个git address命名为test git push test master ``` 补充: git push <远程主机名> <本地分支名>:<远程分支名> git remote -v 以下我们先载入远程仓库,然后查看信息: ``` $ git clone https://github.com/outobe/onetwo $ cd onetwo $ git remote -v origin https://github.com/outobe/onetwo (fetch) origin https://github.com/outobe/onetwo (push) origin 为远程地址的别名。 ``` 显示某个远程仓库的信息: ``` git remote show [remote] ``` 例如: ``` $ git remote show https://github.com/outobe/onetwo * remote https://github.com/outobe/onetwo Fetch URL: https://github.com/outobe/onetwo Push URL: https://github.com/outobe/onetwo HEAD branch: master Local ref configured for 'git push': master pushes to master (local out of date) ``` ####添加远程版本库: git remote add [shortname] [url] shortname 为本地的版本库,例如: ``` # 提交到 Github $ git remote add origin git@github.com:outobe/onetwo.git $ git push -u origin master ``` ####其他相关命令: ``` git remote rm name # 删除远程仓库 git remote rename old_name new_name # 修改仓库名 ```
上一篇:
git:fatal the current branch master has no upstrea
下一篇:
git 账号和密码管理
标题录入,一次不能超过6条
发行自己的加密货币
T:0.004294s,M:237.21 KB
返回顶部
留言
留言
评论