git添加多远端服务器并且实现push代码

star2017 1年前 ⋅ 1880 阅读

1、添加远端服务器

name表示给添加的远端命名,address表示远端的域名或者ip,repo表示远端仓库名

github的远端仓库名有个用户名    username/repo.git

git remote add [name] git@address:repo.git


2.fetch远端代码

branch表示需要fetch的分支

git fetch [name] [branch]


3.merge远端代码与本地的代码

git merge --allow-unrelated-histories [name]/[branch]


4.推送到远端

git push [name] [branch]


更多内容请访问:IT源点

相关文章推荐

全部评论: 0

    我有话说: