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.431git: git version 2.15.0.windows.1
getopt.exe
、libintl3.dll
、libiconv2.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.exe
、libintl3.dll
、libiconv2.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目录下,版本和路径根据自己的情况而定)
打开Git Bash 执行:
$ 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.
参考:https://github.com/nvie/gitflow/
git flow init [-d]
-d 参数表示接受所有默认值
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.
git flow feature publish <name>
git flow feature pull <remote> <name>
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.
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.
git flow support
git flow support start <release> <base>
For support branches, the arg must be a commit on master.
参考 Vincent Driessen 发表的博客:
http://nvie.com/posts/a-successful-git-branching-model/