https://blog.csdn.net/sub_lele/article/details/52289996

git branch help

λ git branch -h
usage: git branch [<options>] [-r | -a] [--merged | --no-merged]
or: git branch [<options>] [-l] [-f] <branch-name> [<start-point>]
or: git branch [<options>] [-r] (-d | -D) <branch-name>...
or: git branch [<options>] (-m | -M) [<old-branch>] <new-branch>
or: git branch [<options>] [-r | -a] [--points-at] Generic options
-v, --verbose show hash and subject, give twice for upstream branch
-q, --quiet suppress informational messages
-t, --track set up tracking mode (see git-pull(1))
--set-upstream change upstream info
-u, --set-upstream-to <upstream>
change the upstream info
--unset-upstream Unset the upstream info
--color[=<when>] use colored output
-r, --remotes act on remote-tracking branches
--contains <commit> print only branches that contain the commit
--abbrev[=<n>] use <n> digits to display SHA-1s Specific git-branch actions:
-a, --all list both remote-tracking and local branches
-d, --delete delete fully merged branch
-D delete branch (even if not merged)
-m, --move move/rename a branch and its reflog
-M move/rename a branch, even if target exists
--list list branch names
-l, --create-reflog create the branch's reflog
--edit-description edit the description for the branch
-f, --force force creation, move/rename, deletion
--merged <commit> print only branches that are merged
--no-merged <commit> print only branches that are not merged
--column[=<style>] list branches in columns
--sort <key> field name to sort on
--points-at <object> print only branches of the object

创建分支

Git branch yourbranch
git checkout yourbranch # 创建并切换到分支
git checkout -b yourbranch

合并分支

git checkout master
git merge yourbranch

git status查看哪些文件需要合并, 合并后提交.

删除分支

git branch -d yourbranch

但是这个只是删除了本地分支, 远程的还在

删除远程分支

git push origin -d yourbranch

分支未合并会提示合并

若分支有修改还未合并,会提示你还没合并。

强行删除本地分支:

git branch -D Su-modify

Git删除本地分支和远程分支的更多相关文章

  1. git 在本地拉取远程分支的代码(并不做提交操作)

    1. git fetch 获取远程的所有分支 2. 在执行 git checkout -b local-branch-name origin/remote-branch  就可以将远程分支remote ...

  2. GIT删除本地tag和远程tag

    以tag test为例,这个tag已经同步到远程,但是现在发现了一个问题,需要撤回该tag,git命令如下: 删除本地tag: git tag -d test 删除远程tag: git push or ...

  3. git 删除本地存在,远程已经删除的分支

    git remote prune origin 强迫症,看到这些分支不一致就来气!

  4. git 删除本地分支和远程分支、本地代码回滚和远程代码库回滚

    [git 删除本地分支] git branch -D br [git 删除远程分支] git push origin :br  (origin 后面有空格) git代码库回滚: 指的是将代码库某分支退 ...

  5. 【GIT】git 删除本地分支和远程分支、本地代码回滚和远程代码库回滚

    [git 删除本地分支] git branch -D br [git 删除远程分支] git push origin :br  (origin 后面有空格) git代码库回滚: 指的是将代码库某分支退 ...

  6. git 删除本地分支、远程分支、本地回滚、远程回滚

    一. git 删除分支 1. git 删除本地分支 git branch -D branchname 2. git 删除远程分支 git push origin :branchname (origin ...

  7. git删除本地分支和删除远程分支

    引言: 切换分支的时候命令打错了,git checkout 后面没有跟分支名,结果git status,很多delete的文件,直接冒冷汗,git add ,commit 之后发现本地与远程确实是删除 ...

  8. git 本地分支与远程分支 新建/删除/合并

    github上已经有master分支 和dev分支 在本地 git checkout -b dev 新建并切换到本地dev分支 git pull origin dev 本地分支与远程分支相关联 在本地 ...

  9. 【转】git 删除本地分支和远程分支、本地代码回滚和远程代码库回滚

    转载自:http://m.blog.csdn.net/blog/lihongli528628/45483463 [git 删除本地分支] git branch -D br [git 删除远程分支] g ...

  10. git操作:查看分支、删除本地分支和远程分支

    1.查看本地分支:git branch 2.查看远程分支:git branch -r 或 git branch --remote 3.查看本地和远程的所有分支:git branch -a 4.删除本地 ...

随机推荐

  1. 035 控制并发 select * from test1 where id =1 for update 就会对这行加锁了?

    今天在看同事程序的时候,看到这种用法,顺便学习下. 一:理论 1.功能 这个功能是上锁. 上的是一个排它锁,也就是说,其他的事务是可以读取的.但是不能写入或者更新. 二:实践 1.创建表 2.提交一条 ...

  2. bind注意事项(传引用参数的时候)

    默认情况下,bind的那些不是占位符的参数被拷贝到bind返回的可调用对象中. 当需要把对象传到bind中的参数中时,需要使用ref或者cref. 例如: #include<iostream&g ...

  3. Unable to load configuration. - action - file:/F:/apache-tomcat-8.0.30/webapps/test1Struts2/WEB-INF/classes/struts.xml:11:71

    Unable to load configuration. - action - file:/F:/apache-tomcat-8.0.30/webapps/test1Struts2/WEB-INF/ ...

  4. 《Android高级进阶》读书笔记

    <Android高级进阶>是据我所知的市面上唯一一本技术工具书,比较的高大全,作者的目的是为了对全领域有个初步的概念 No1: 在Android系统中,拥有事件传递处理能力的类有以下三种 ...

  5. 6. 合并排序数组 II

    6. Merge Two Sorted Arrays Description Merge two given sorted integer array A and B into a new sorte ...

  6. 蓝桥杯 ——无重复组合——C++

    问题描述: 求任意长度的(ABCD.....)全部n=0,1,2 ....组合情况(n小于等于串的长度) 解决思路: 如果串的长度固定,n的值固定循环嵌套 在这里以深度优先形成一棵树,如下图: 源代码 ...

  7. 2017-9-8-RaspberryPi安装过程

    设备: RaspberryPi 3B 安装版本: 2017-01-11-raspbian-jessie.img 第一步:准备好8G以上tf卡.Win32DiskImager.SD Formatter. ...

  8. Docker——error pulling image configuration

    执行Docker命令 $ docker image build . 报错如下: error pulling image configuration: Get https://production.cl ...

  9. [蓝点ZigBee] Zstack 之点亮OLED液晶 ZigBee/CC2530 视频资料

    这一小节主要演示如何在Zstack 下移植液晶驱动,我们选取了目前比较流行的OLED 作为移植目标. 移植关键点 1 修改 GPIO pin,                  2 如何将Zstack ...

  10. nodejs,koa2常用模块

    "dependencies": { "multer": "^1.2.0", "node-schedule": " ...