git 删除,同步远程分支

先建立本地分支  git checkout -b bug

(我是在beta-stable分支创建的)意思就是 beta-stable 分支 多了一个分支,叫bug。以后改完bug传到 beta-stable 就行了,你想在哪个分支该比较紧急的bug,就在哪个分支 checkout -b xxx 就行了。

bug分支同步远程分支

同步前    bug => ‘‘

git push --set-upstream origin bug (同步)

同步后   bug => ‘origin/bug‘

巴拉巴拉的改了一堆

改完了,删除掉他,先把远程的删除掉

git push origin --delete bug

再把本地的删掉,前期要切换到其他的分支,不然报错说 error: Cannot delete branch ‘bug‘ checked out at ********* (你项目的路径)

切换到其它分支之后,删除本地分支

git branch -D bug

OJBK。完事儿!

原文地址:https://www.cnblogs.com/wangshuazi/p/9642246.html

时间: 2024-08-01 07:00:16

git 删除,同步远程分支的相关文章

GIT实践:同步远程分支

GIT实践:同步远程分支 更新远程分支 当Git仓库地址发生变化后,首先更新远程地址 git remote set-url origin [email protected]:NEW_GROUP/ncc-quartz.git 或者 git remote set-url origin http://git.yonyou.com/NCC_UAP/ncc-quartz.git 原文地址:https://www.cnblogs.com/MrSaver/p/11825330.html

[git] git拉取远程仓库,同步远程分支,解决冲突

[git] git拉取远程仓库,同步远程分支,解决冲突 1.本地仓库存在 本地仓库与远程master已绑定 1.拉取远程分支到本地 git fetch origin dev(远程分支名) 2.在本地创建该分支并切换 git checkout -b dev(本地分支名) origin/dev(远程分支名) 3.把分支代码拉取到本地 git pull origin origin dev(远程分支名) 2.本地仓库不存在 1.克隆远程仓库 git clone 远程库地址 2.拉取远程分支到本地 git

git本地与远程分支

已经有远程分支,在本地检出,并且关联到远程分支 git checkout --trach origin/远程分支名 git checkout -b 本地分支名  origin/远程分支名 $ git checkout --track origin/dev $ git checkout -b dev origin/dev 没有远程分支,本地有一个分支,要推送到远程 git push --set-upstream origin 分支名 git push -u origin 分支名 git push

git 拉取远程分支报错(fatal: '' is not a commit and a branch '' cannot be created from it)

问题描述从远程git上拉取某一个分支,然后报错,拉取不了这个分支. 拉取分支的命令: git checkout -b xxx-static-19 origin/xxx-static-19 其中xxx-static-19是分支名. 报错 fatal: 'origin/xxx-static-19' is not a commit and a branch 'xxx-static-19' cannot be created from it 解决重新拉取数据,git pull ,然后再切回分支 git

Git 同步远程分支( prune )

当你的远程分支已删除时,本地Gitbranch-a 查看时,发现那些删除的分支还在,想删除?那恭喜你,就可以使用下面这两个分支了: git fetch origin --prune or git remote prune origin

【记录】git 拉取远程分支代码,同步到另一个git上

最近有需求从某git 上拉取所有分支代码同步到另一git上,现记录操作步骤,以便日后使用: 1:先克隆其中一个分支代码到本地环境 git clone -b test http://账号:密码@XXX.git 2:查看本地分支 git brach 3:查看远程分支 git branch -r 4:查看远程所有分支  远程分支会用红色表示出来(如果你开了颜色支持的话 git branch -a 5:-a命令并没有每一次都从远程更新仓库信息,我们可以手动更新一下 git fetch origin gi

Git拉取远程分支命令

如果我们想从Git仓库中拉取一个分支到本地,此处假如远程分支为develop,本地要创建的分支为dev,可以使用以下命令: git init    //初始化本地Git仓库 git remote add origin https://xxx.git  //将本地仓库和远程仓库相关联 git fetch origin develop git checkout -b dev origin/develop //在本地创建分支dev,并将远程分支develop的信息同步到本地分支dev 这样我们就拉取了

git拉取远程分支并创建本地分支

本地分支推送至远程 git checkout local_branch git push origin local_branch:remote_branch 一.查看远程分支 使用如下Git命令查看所有远程分支: git branch -r 列出本地分支: git branch 删除本地分支: git branch -D BranchName 其中-D也可以是--delete,如: git branch --delete BranchName  删除本地的远程分支: git branch -r

git拉取远程分支并切换到该分支

整理了五种方法,我常用最后一种,这五种方法(除了第4中已经写了fetch的步骤)执行前都需要执行git fetch来同步远程仓库 (1)git checkout -b 本地分支名 origin/远程分支名 (2)git checkout --track origin/远程分支名 (这种写法是上面的简化版,效果完全一样) (3)git checkout -t origin/远程分支名(这种写法是2的简化版) (4)fetch指定的一个分支:git fetch [repo] [remote_bran