git基础

作者: overflow_hidden | 来源:发表于2017-02-15 14:34 被阅读8次
git:代码管理仓库

1、创建本地分支 local_branch

git  branch local_branch

2、创建本地分支local_branch 并切换到local_branch分支

git checkout -b local_branch

3、切换到分支local_branch

git checkout local_branch

4、推送本地分支local_branch到远程分支 remote_branch并建立关联关系

a.远程已有remote_branch分支并且已经关联本地分支local_branch且本地已经切换到local_branch

git push

b.远程已有remote_branch分支但未关联本地分支local_branch且本地已经切换到local_branch

git push -u origin/remote_branch

c.远程没有有remote_branch分支并,本地已经切换到local_branch

git push origin local_branch:remote_branch

5、删除本地分支local_branch

git branch -d local_branch

6、删除远程分支remote_branch

git push origin  :remote_branch

git branch -m | -M oldbranch newbranch 重命名分支,如果newbranch名字分支已经存在,则需要使用-M强制重命名,否则,使用-m进行重命名。

git branch -d | -D branchname 删除branchname分支

git branch -d -r branchname 删除远程branchname分支

7、查看本地分支

git branch

8、查看远程和本地分支

git branch -a

相关文章

  • 2.Git初步

    Git是什么 Git是什么 Git基础 Git基础 1. 下载安装Git GIT官网 安装好后,按win+R 输入...

  • Git总结

    初步 下载git 基础配置: 基础操作 获取Git仓库 初始化现有仓库 git init 克隆远程仓库 git c...

  • Git基本操作

    一、 git的基础操作 基础操作 1.在项目里创建一个git : $ git init 链接远程项目: $ git...

  • git操作

    git基础命令: git commit ---- 提交git branch newBranchName --- 新...

  • Git

    关于版本控制 Git 简史 Git 基础 安装 Git Git 前的配置

  • 2.3 Git 基础 - 查看提交记录

    提交记录git log 2.2 Git 基础 - 记录每次更新到仓库(删除和改名)2.4 Git 基础 - 撤销操...

  • 面试中的那些 Git 问题 - 基础部分

    面试中的那些 Git 问题 - 基础部分 面试中的那些 Git 问题 - 基础部分

  • 2016-06-24 阅读整理

    Git Git 基础命令Git 分支管理Git 分支合并Git 公钥提交Git 常用技巧Git 设置别名 Andr...

  • Git 系列文章

    GIT 初识 Git的基础操作 Git的远程操作 Git的分支管理 Git标签操作 Git团队协作 Git 多账户...

  • git资源学习

    git资源学习 Git详解之一 Git起步 Git详解之二 Git基础 Git详解之三 Git分支 Git详解之四...

网友评论

      本文标题:git基础

      本文链接:https://www.haomeiwen.com/subject/yxpkuttx.html