在Windows上的安装git-flow和使用git-flow

一、github地址

https://github.com/nvie/gitflow/

二、安装

windows 下安装参考 https://github.com/nvie/gitflow/wiki/Windows

我安装过程:

参考:Git for Windows (previously MSysGit)
https://github.com/nvie/gitflow/wiki/Windows#git-for-windows-previously-msysgit


环境: window10: 版次: window10 家庭中文版 版本:
1709 OS内部版本: 16299.431

git: git version 2.15.0.windows.1

2、1 复制getopt.exelibintl3.dlllibiconv2.dll 到git 的安装目录下的bin目录下

按照官方给出的安装方法:

Download and install getopt.exe from the util-linux package into
C:\Program Files\Git\bin. (Only getopt.exe, the others util-linux
files are not used). Also install libintl3.dll and libiconv2.dll from
the Dependencies packages (libintl and libiconv), into the same
directory.

依次点击三个链接,把getopt.exelibintl3.dlllibiconv2.dll 三个东西下载复制到git 的安装目录下的bin目录下
我的是D:\OpenSource\Git\bin,其中D:\OpenSource\Git是git 的安装目录

注意,三个要下载的都是Binaries
的zip格式文件,下载完后只需要把各自bin目录下的对应文件复制到git安装目录的bin目录下即可,其他的都不需要(比如,对于getopt.exe来说,打开util-linux-ng-2.14.1-bin.zip\bin,复制getopt.exe到D:\OpenSource\Git\bin目录下,版本和路径根据自己的情况而定)

2、2 Clone the git-flow sources from GitHub

打开Git Bash 执行:

扫描二维码关注公众号,回复: 11035358 查看本文章
$ git config --global url."https://github".insteadOf git://github

如果不执行这条命令,直接执行下面命令的话,clone 会出现卡住现象

$ git clone --recursive git://github.com/nvie/gitflow.git

上面命令在那个目录下执行就把gitflow下载到那里

打开powershell(以管理员身份运行), cd 到下载gitflow 的目录下

PS E:\安装包\git-flow\gitflow> .\contrib\msysgit-install.cmd "D:\OpenSource\Git"

D:\OpenSource\Git 根据安装git的安装目录进行调整

测试是否安装成功
打开Git Bash

$ git flow help
usage: git flow <subcommand>

Available subcommands are:
   init      Initialize a new git repo with support for the branching model.
   feature   Manage your feature branches.
   bugfix    Manage your bugfix branches.
   release   Manage your release branches.
   hotfix    Manage your hotfix branches.
   support   Manage your support branches.
   version   Shows version information.
   config    Manage your git-flow configuration.
   log       Show log deviating from base branch.

Try 'git flow <subcommand> help' for details.

三、使用git-flow

参考:https://github.com/nvie/gitflow/

初始化

git flow init [-d]

-d 参数表示接受所有默认值

Creating feature/release/hotfix/support branches

  • To list/start/finish feature branches, use:
  git flow feature
  git flow feature start <name> [<base>]
  git flow feature finish <name>

For feature branches, the arg must be a commit on develop.

  • To push/pull a feature branch to the remote repository, use:
git flow feature publish <name>
git flow feature pull <remote> <name>
  • To list/start/finish release branches, use:
git flow release
git flow release start <release> [<base>]
git flow release finish <release>

release写法,比如:1.0.0
For release branches, the arg must be a commit on develop.

  • To list/start/finish hotfix branches, use:
  git flow hotfix
  git flow hotfix start <release> [<base>]
  git flow hotfix finish <release>

For hotfix branches, the arg must be a commit on master.

  • To list/start support branches, use:
  git flow support
  git flow support start <release> <base>

For support branches, the arg must be a commit on master.

四、Git Flow 的介绍

参考 Vincent Driessen 发表的博客:
http://nvie.com/posts/a-successful-git-branching-model/

发布了23 篇原创文章 · 获赞 13 · 访问量 9万+

猜你喜欢

转载自blog.csdn.net/seek_of/article/details/80320065