1)上传本地代码到TFS

a.Generate Git Credentials,即创建git账户密码

b)上传本地代码

git add *
git commit -m "纳入管理" git remote add origin https://qiongyan2.visualstudio.com/_git/BeibeiCore2
git push -u origin --all
{{-u参考链接:https://www.zhihu.com/question/20019419/answer/83091592}}
git remote rm origin
Username for 'https://qiongyan2.visualstudio.com': qiongyan2@126.com
Password for 'https://qiongyan2@126.com@qiongyan2.visualstudio.com':

2)git 分支

也可以参考此文:Git 在团队中的最佳实践--如何正确使用Git Flow

作者:khowarizmi
链接:https://www.zhihu.com/question/21995370/answer/33172036
来源:知乎
著作权归作者所有,转载请联系作者获得授权。

写在前面:
1. 建议使用source tree或者其他的gui工具。
2. 安装oh-my-zsh
开始回答问题:
最近在看git关于分支的管理,发现可以用git-flow来管理分支。先贴上项目地址nvie/gitflow · GitHub
git-flow主要有5中分支:master、hotfix、release、develop、feature。

feature分支开始于develop分支,完成以后合并到develop分支。

当完成一定数量feature分支以后,从develop再开一个release分支出来,这些特性将被更新到下一个发布的版本中,之后的feature将不会被合并到release中。

之后在release分支中,只修改bug,然后完成release分支。完成release分支会完成以下三个操作:1、合并release分支到master;2、给master打上版本的标签;3、release回归到develop分支。

当发现master上有bug时,开一个hotfix,完成后合并到master分支。

基本的开发流程就是这样,不清楚的可以看看文档Gitflow Workflow

PS:source tree中已经集成了git-flow使用感受良好

3) Git Flow代码示例

a. 创建develop分支

git branch develop
git push -u origin develop
b. 开始新Feature开发 git checkout -b some-feature develop
# Optionally, push branch to origin:
git push -u origin some-feature # 做一些改动
git status
git add some-file
git commit
c. 完成Feature git pull origin develop
git checkout develop
git merge --no-ff some-feature
git push origin develop git branch -d some-feature # If you pushed branch to origin:
git push origin --delete some-feature
d. 开始Relase git checkout -b release-0.1.0 develop # Optional: Bump version number, commit
# Prepare release, commit
e. 完成Release git checkout master
git merge --no-ff release-0.1.0
git push git checkout develop
git merge --no-ff release-0.1.0
git push git branch -d release-0.1.0 # If you pushed branch to origin:
git push origin --delete release-0.1.0 git tag -a v0.1.0 master
git push --tags
f. 开始Hotfix git checkout -b hotfix-0.1.1 master
g. 完成Hotfix git checkout master
git merge --no-ff hotfix-0.1.1
git push git checkout develop
git merge --no-ff hotfix-0.1.1
git push git branch -d hotfix-0.1.1 git tag -a v0.1.1 master
git push --tags

4)本地测试git flow

书本目录:https://git-scm.com/book/zh/v2

qiongyazhudembp:BeibeiCore qiongyanzhu$ git branch --all
* master
remotes/origin/master
qiongyazhudembp:BeibeiCore qiongyanzhu$

  

$ git branch develop
$ git branch --all
develop
* master
remotes/origin/master

  然也可以同步

$ git push -u origin develop:develop
Total 0 (delta 0), reused 0 (delta 0)
To https://qiongyan2.visualstudio.com/_git/BeibeiCore2
* [new branch] develop -> develop
Branch develop set up to track remote branch develop from origin.
$ git branch --all
develop
* master
remotes/origin/develop
remotes/origin/master 

$ cat .git/refs/heads/master
54b20f4c9f793ad1fc59f4e4b03867c93ad2bca7
$ git checkout develop
Switched to branch 'develop'
Your branch is up-to-date with 'origin/develop'.
$ git branch --all
* develop
master
remotes/origin/develop
remotes/origin/master

远程如果已经有develop分支

5) 代码编写有误,放弃工作区的修改

$ git diff 工作区与暂存区(提交暂存区,stage)相比的差异

$ git checkout bootstrap.js

[TFS4]TFS git地址,分支概念的更多相关文章

  1. git 利用分支概念实现一个仓库管理两个项目

    需求描述:开发了一个网站,上线之际,突然另一个客户说也想要个一样的网站,但网站的logo和内部展示图片需要替换一下,也就是说大部分的后台业务逻辑代码都是一致的,以后升级时功能也要保持一致:刚开始想反正 ...

  2. [Notice]博客地址转移 vitostack.com

    个人博客地址转移至vitostack.com 这里可能不会经常更新. 欢迎访问新地址.

  3. Git之(一)Git是什么[转]

    为什么使用Git 孔子曾经曰过的,名正则言顺 言顺则事成. 我们在学习一项新技术之前,弄清楚为什么要学它至关重要,至于为什么要学习Git,我用一段if-else语句告诉你原因: if(你相信我){ 我 ...

  4. [转]Git入门与实践(一)

    git入门与实践(一) ·        March 10th, 2010 ·        Posted in UNIX环境编程 ·        By ghosTM55 Write comment ...

  5. 你真的了解git的分支管理跟其他概念吗?

    现在前端要学的只是太多了,你是不是有时会有这个想法,如果我有两个大脑.一个学Vue,一个学React,然后到最后把两个大脑学的知识再合并在一起,这样就能省时间了. 哈哈,这个好像不能实现.现实点吧!年 ...

  6. 使用TFS+GIT实现分布式项目管理

    前言 GIT是近来很流行的一种版本控制系统,是Linux内核之父Linus Torvalds为了管理Linux内核的开发而开发的一种开源的版本控制工具. GIT相比传统的版本控制工具最大的优点是实现了 ...

  7. Git 入门:概念、原理、使用

    出处: git入门:概念.原理.使用 git和Github 概念 Git --- 版本控制工具(命令). git是一个开源的分布式版本控制系统,用以有效.高速的处理从很小到非常大的项目版本管理.git ...

  8. [caffe]linux下安装caffe(无cuda)以及python接口

    昨天在mac上折腾了一天都没有安装成功,晚上在mac上装了一个ParallelDesktop虚拟机,然后装了linux,十分钟就安装好了,我也是醉了=.= 主要过程稍微记录一下: 1.安装BLAS s ...

  9. Git 的核心概念解读

    本文不是Git使用教学篇,而是偏向理论方面,旨在更加深刻的理解Git,这样才能更好的使用它,让工具成为我们得力的助手. 版本控制系统 Git 是目前世界上最优秀的分布式版本控制系统.版本控制系统是能够 ...

随机推荐

  1. 一起talk C栗子吧(第九回:C语言实例--最大公约数)

    各位看官们,大家好.从今天開始,我们讲大型章回体科技小说 :C栗子,也就是C语言实例.闲话休提, 言归正转.让我们一起talk C栗子吧! 看官们.上一回中咱们说的是素数的样例.这一回咱们说的样例是: ...

  2. libcurl 通过http协议下载文件并显示下载进度

    vc6 测试工程下载地址:http://download.csdn.net/detail/mtour/8068053 代码如下: size_t my_write_func(void *ptr, siz ...

  3. WCF REST (二)

    今天主要写下  POST等其他方式 发送请求 以及 流方式 文件的上传与下载 一.Post 提交数据 先来想下 POST和Get 的不同   Get 方式 我们直接通过 url  来传递参数   先来 ...

  4. μC/OS中的任务就绪表

    为了便于对就绪表的查找,μC/OSII又定义了一个数据类型为INT8U的变量OSRdyGrp, 并使该变量的每一位都对应OSRdyTbl[ ]的一个任务组(即数组的一个元素),如果某任务组中 有任务就 ...

  5. [React Intl] Format a Date Relative to the Current Date Using react-intl FormattedRelative

    Given a date, we’ll use the react-intl FormattedRelative component to render a date in a human reada ...

  6. Codeforces 145A-Lucky Conversion(规律)

    A. Lucky Conversion time limit per test 2 seconds memory limit per test 256 megabytes input standard ...

  7. Storm新特性之Flux

    Storm新特性之Flux Flux是Storm版本号0.10.0中的新组件,主要目的是为了方便拓扑的开发与部署.原先在开发Storm拓扑的时候整个拓扑的结构都是硬编码写在代码中的,当要对其进行改动时 ...

  8. 实现indexOf

    1.先判断Array数组是否含有indexOf方法,如果有直接返回结果:如果没有则利用循环比较得到结果. function indexOf(arr, item) { if(Array.prototyp ...

  9. HDU 2147kiki's game

    KIKI和zz一起玩跳棋游戏,KIKI先.跳棋棋盘有n行m列.在顶行的最右侧位置放上一枚硬币.每次每个人可以把硬币移动到左边,下边或是左下边的空格中.最后不能移动硬币的那个人将输掉比赛. P点:即必败 ...

  10. [Nuxt] Setup a "Hello World" Server-Rendered Vue.js Application with the Vue-CLI and Nuxt

    Install: npm install -g vue-cli Init project: vue init nuxt/starter . Run: npm run dev Create a inde ...