1. display all the branches

git branch -a

2. delete branches

git br -d <branch> # 删除某个分支

git br -D <branch> # 强制删除某个分支 (未被合并的分支被删除的时候需要强制)

 分支合并和rebase

git merge <branch> # 将branch分支合并到当前分支

git merge origin/master --no-ff # 不要Fast-Foward合并,这样可以生成merge提交
Make sure you have the latest code
$git pull
Create your local_branch and checkout to it from [master]
$git checkout -b loca_branch
Modify your code and add all modified files you want to commit
$git add -A
Input commit messages $git commit -s
Create your remote_local_branch and push your commit to it. $git push origin local_branch:remote_local_branch
 
查看分支
git branch
或者
git branch -v A) 创建分支
git branch mystudygit1. B) 切换分支
git checkout mystudygit1. C) 删除分支
git branch -d mystudygit1. //如果该分支没有合并到主分支会报错
或者
git branch -D mystudygit1. //强制删除 D) 分支合并
比如,如果要将开发中的分支(develop),合并到稳定分支(master),
首先切换的master分支:git checkout master。
然后执行合并操作:git merge develop。
如果有冲突,会提示你,调用git status查看冲突文件。
解决冲突,然后调用git add或git rm将解决后的文件暂存。
所有冲突解决后,git commit 提交更改。
例如:将acc2f69提交合并到当前分支
git merge acc2f69 E)合并 git如何clone 远程github中的分支?
git clone -b release_branch https://github.com/jetty/
 

How to push your code in git的更多相关文章

  1. git push代码时的'git did not exit cleanly (exit code 1)'问题解决

    在利用git管理本地发布的galleryLeftOrRight插件项目时,按照git的使用方法:先commit→master,再 push,发现提示错误git did not exit cleanly ...

  2. 使用vs code实现git同步

    用了git最方便的就是项目同步管理,回到家打开vscode只需要点击一下pull就能全部同步过来.是不是很方便....毕竟之前我都是拿u盘拷贝回家或者存到云盘再下载下来..   我这里用的是国内的码云 ...

  3. VS Code使用Git管理代码

    Visual Studio Code(简称VS Code)是一个轻量级且强大的代码编辑器,后台是微软,支持Windows.Mac和Linux操作系统,拥有丰富的插件生态系统,可通过安装插件来支持C++ ...

  4. 【转载】使用阿里云code和git管理项目

    使用代码云托管和git来管理项目可以使多客户端和多人开发更加高效.通过对比github,bitbucket和国内一些云托管服务发现阿里云在项目空间和传输速度及稳定性上更能满足公司开发的要求.本文将介绍 ...

  5. Salesforce学习之路(三)利用VS Code结合Git开发Salesforce

    在前面说了一些有关Admin的知识,但实际开发运用中,仅凭Admin的配置很难满足项目的定制化需求,因此基于CRM的二次开发则应运而生. 由于国内资料相对较少,所以很多入门新手无处下手,那这里就简单介 ...

  6. Visual Studio Code 使用Git进行版本控制

    Visual Studio Code 使用Git进行版本控制 本来认为此类教程,肯定是满网飞了.今天首次使用VS Code的Git功能,翻遍了 所有中文教程,竟没有一个靠谱的.遂动笔写一篇. 请确保你 ...

  7. git push origin master、git pull出现如下错误

    git push origin master出现如下错误: Counting objects: , done. Writing objects: % (/), bytes, done. Total ( ...

  8. 【转】Visual Studio Code 使用Git进行版本控制

    原文链接:https://www.cnblogs.com/xuanhun/p/6019038.html?utm_source=tuicool&utm_medium=referral 本来认为此 ...

  9. 解决failed to push some refs to git

    Administrator@PC-20150110FGWU /K/cocos2d/yc (master) $ git push -u origin master To git@github.com:y ...

随机推荐

  1. 使用 margin 让div块内容居中

    问:有一个div块,其width为300px,如何设置margin让div块居中显示? 答:margin设置为 margin:0 auto,即div块的上下外边距设置为 0 , 左右外边距设置为 自动 ...

  2. 基于theano的深度卷积神经网络

    使用了两个卷积层.一个全连接层和一个softmax分类器. 在测试数据集上正确率可以达到99.22%. 代码参考了neural-networks-and-deep-learning #coding:u ...

  3. sybase参数调整

  4. 给 input 中 type="text" 设置CSS样式

    input[type="text"], input[type="password"] {    border: 1px solid #ccc;    paddi ...

  5. 查询oracle RAC实例名称等信息

    select * from gv$instance;

  6. Spark(四): Spark-sql 读hbase

    SparkSQL是指整合了Hive的spark-sql cli, 本质上就是通过Hive访问HBase表,具体就是通过hive-hbase-handler, 具体配置参见:Hive(五):hive与h ...

  7. ckeditor中“浏览服务器”的后台操作

    此博文,基于CKeditor 4.5.6版本测试通过. 原创博文,转载请注明出处 参考官方文档,以及网络上的一些帖子.经过调试得到正确的期待中的结果. [网络上的一些所谓的帖子,不知道是故意将上传的代 ...

  8. 区别: @Secured(), @PreAuthorize() 及 @RolesAllowed()

    在Spring security的使用中,为了对方法进行权限控制,通常采用的三个注解,就是@Secured(), @PreAuthorize() 及 @RolesAllowed(). 但是着三者之间的 ...

  9. App开发者必备的运营、原型、UI设计工具整理

    移动应用开发者们,Attention please!在接下来的内容里,我们将介绍一些能够提高你们的应用的知名度和品质水平的工具. 仔细看看,下面这些工具你们都知道吗,用过吗?如果你还不知道,或许可以尝 ...

  10. 转: ExtJS中xtype一览

    转: ExtJS中xtype一览 基本组件: xtype Class 描述 button Ext.Button 按钮 splitbutton Ext.SplitButton 带下拉菜单的按钮 cycl ...