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. 为什么golang的开发效率高(编译型的强类型语言、工程角度高、在开发上的高效率主要来自于后发优势,编译快、避免趁编译时间找产品妹妹搭讪,既是强类型语言又有gc,只要通过编译,非业务毛病就很少了)

    作者:阿猫链接:https://www.zhihu.com/question/21098952/answer/21813840来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商业转载请注明出 ...

  2. php线性表数组实现的删除操作

    php线性表数组实现的删除操作 一.总结 1.array_pop(): 函数删除数组中的最后一个元素. 二.代码 代码一: //线性表的删除(数组实现) function delete_array_e ...

  3. 14.inline与namespace使用

    #include <iostream> using namespace std; namespace all { //inline作用为默认调用 inline namespace V201 ...

  4. PHP模拟链表操作

    PHP模拟链表操作 一.总结 1.类成员用的是-> 2.对象节点相连的话,因为是对象,所以不用取地址符号 3.数组传递参数的时候传引用的方法 ,& 二.PHP模拟链表操作 代码一: /* ...

  5. (转)oracle表空间使用率统计查询

    转自:http://www.cnblogs.com/xwdreamer/p/3511047.html 参考文献 文献1:http://blog.itpub.net/24104518/viewspace ...

  6. (转)Oracle命令

    转自:http://www.cnblogs.com/NaughtyBoy/p/3181052.html Oracle登录命令 1.运行SQLPLUS工具 C:\Users\wd-pc>sqlpl ...

  7. [React Intl] Install and Configure the Entry Point of react-intl

    We’ll install react-intl, then add it to the mounting point of our React app. Then, we’ll use react- ...

  8. maven 怎么在MyEclipse中打开Navigator视图

    方法一:1.点击菜单window2.选择show view菜单项3.选择other菜单项4.点击general,在其中可以找到 方法二:1.点击菜单window2.选择show view菜单项3.选择 ...

  9. js和jquery实现页面滚动监听

    js和jquery实现页面滚动监听 一.总结 一句话总结:onscroll方法和监听页面元素的高度都可以实现滚动监听. 1.onscroll方法实现滚动监听的核心代码是什么? <body ons ...

  10. 修复STS4 server中没有Tomcat的问题(必看,官方推荐,包教包会,国内首发)

    版权声明:原创.欢迎转载,转载请注明来源,谢谢. https://blog.csdn.net/qq_41910280/article/details/83279129 修复STS4 server中没有 ...