apollo branch pull 'upload' delete

Upload branch from local to gitlab:

If there is no branch before: git init (refer to the new branch article)

查看当前获取及推送地址是否一致: git remote -v

如果不一致,删除远程origin分支: git remote rm origin #oringin是存储网址的变量,也可以更改成自己熟悉的名字.

重新添加远程地址: git remote add origin <URL网址>

推送master至远程origin: git push -u origin branchname

Pull branch from gitlab to local:

First of all, we must know the address of the pull branch. There will be many small branches under the address of the pull branch.

As with the upload branch, you need to add a remote address:git remote add origin <URL网址> 

接下来就是拉取分支:

1.拉取分支到本地,但并不融合:
git fetch origin remote_branch_name:loacl_branch_name(拉取远程分支到本地后起的名字)

2. Pull the branch to the local and merge:
git pull origin remote_branch_name:loacl_branch_name(拉取远程分支到本地后起的名字)

Delete branch

git branch -m oldbranch newbranch(新名字)

 

Published 18 original articles · won praise 1 · views 2685

Guess you like

Origin blog.csdn.net/taochengwu123/article/details/89488416
Recommended