Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitflow
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tools
gitflow
Commits
1ffb6b10
Commit
1ffb6b10
authored
Feb 14, 2011
by
Vincent Driessen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'release/0.4.1'
parents
dc5d08df
4b5b9320
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
136 additions
and
114 deletions
+136
-114
AUTHORS
AUTHORS
+1
-0
Changes.mdown
Changes.mdown
+14
-0
README.mdown
README.mdown
+64
-84
git-flow-feature
git-flow-feature
+5
-7
git-flow-hotfix
git-flow-hotfix
+2
-2
git-flow-init
git-flow-init
+43
-10
git-flow-release
git-flow-release
+1
-1
git-flow-version
git-flow-version
+1
-1
gitflow-common
gitflow-common
+5
-9
No files found.
AUTHORS
View file @
1ffb6b10
...
...
@@ -10,5 +10,6 @@ Authors are (ordered by first commit date):
- Nowell Strite
- Felipe Talavera
- Guillaume-Jean Herbiet
- Joseph A. Levin
Portions derived from other open source works are clearly marked.
Changes.mdown
View file @
1ffb6b10
0.4.1:
-----
Release date: **2011/02/04**
* New option `-d` added to `git flow init`, to initialize with defaults without
asking for input interactively. Ideal for creating git-flow enabled repos in
custom scripts.
* The parsing issues related to git-flow feature's flags are now dealt with on
all known platforms. (Fixed #54, #62, #86, #97)
* Escape queries for detecting branch/tag names. (Fixed #91)
0.4:
---
Release date: **2010/10/18**
...
...
README.mdown
View file @
1ffb6b10
git-flow
git-flow

========
A collection of Git extensions to provide high-level repository operations
for Vincent Driessen's [branching model](http://nvie.com/git-model "original
blog post").
Getting started
---------------
For the best introduction to get started with `git flow`, please read Jeff
Kreeftmeijer's blog post:
[http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/](http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/)
Or have a look at one of these screen casts:
* [A short introduction to git-flow](http://vimeo.com/16018419) (by Mark Derricutt)
* [On the path with git-flow](http://codesherpas.com/screencasts/on_the_path_gitflow.mov) (by Dave Bock)
Installing git-flow
-------------------
The easiest way to install git-flow is using Rick Osborne's excellent
git-flow installer, which can be run using the following command:
$ wget -q -O - http://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sudo sh
### Mac OS
If you're on a Mac and use [homebrew](http://github.com/mxcl/homebrew), it's simple:
$ brew install git-flow
If you're on a Mac and use [MacPorts](http://macports.org/), it's simple:
$ port install git-flow
### Linux, etc.
Another easy way to install git-flow is using Rick Osborne's excellent git-flow
installer, which can be run using the following command:
For __OSX__ users, the `wget` command isn't available by default, but `curl` is, so you can run:
$ wget --no-check-certificate -q -O - https://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sudo sh
$ curl http://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sudo sh
### Windows
#### Using Cygwin
For Windows users who wish to use the automated install, it is suggested that you install [Cygwin](http://www.cygwin.com/)
first to install tools like `git`, `util-linux` and `wget` (with those three being packages that can be selected
during installation). Then simply run this command from a Cygwin shell:
For __Windows__ users who wish to use the automated install, it is suggested that you install [Cygwin](http://www.cygwin.com/)
first to install tools like sh and wget. Then simply follow the command:
$ wget -q -O - https://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sh
c:\Users\<user> wget -q -O - http://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sh
#### Using msysgit
This is much like the manual installation below, but there are additional steps required to install some extra tools that
are not distributed with [msysgit](http://code.google.com/p/msysgit/).
If you prefer a manual installation, please use the following instructions.
After downloading the sources from Github, also fetch the submodules:
Clone the git-flow sources from Github:
$ git submodule init
$ git submodule update
$ git clone --recursive git://github.com/nvie/gitflow.git
Copy git-flow's relevant files to your msysgit installation directory:
$ mkdir /usr/local/bin
$ cp git-flow* gitflow* /usr/local/bin/
$ cp shFlags/src/shflags /usr/local/bin/gitflow-shFlags
Next up we need to borrow a couple of binaries from [Cygwin](http://www.cygwin.com/). If you don't have Cygwin installed, please
install it including the `util-linux` package. Apart from `util-linux`'s dependencies, no other packages are required. When you
finished installation, copy the following files using msysgit's _Git Bash_. We assume the Cygwin's default installation path in C:\cygwin.
$ cd /c/cygwin/
$ cp bin/getopt.exe /usr/local/bin/
$ cp bin/cyggcc_s-1.dll /usr/local/bin/
$ cp bin/cygiconv-2.dll /usr/local/bin/
$ cp bin/cygintl-8.dll /usr/local/bin/
$ cp bin/cygwin1.dll /usr/local/bin/
After copying the files above, you can safely uninstall your Cygwin installation by deleting the C:\cygwin directory.
### Manual installation
If you prefer a manual installation, please use the following instructions:
$ git clone --recursive git://github.com/nvie/gitflow.git
Then, you can install `git-flow`, using:
...
...
@@ -61,69 +110,8 @@ starting place for installing git.
FAQ
---
* **Can I still do manual branches and merges when I use git-flow?**
Of course you can. `git-flow` does not forbid you to keep using vanilla Git
commands!
So if you want to merge `master` into `develop` for whatever reason you want
to, you can safely do so without breaking `git-flow` compatibility. Do you
want to manually merge a feature branch X into another feature branch Y? Not
a problem. As long as you do it conciously and realize what this means for
finishing those branches later on.
* **Why does git-describe not work for me?**
When finishing release and hotfix branches, that branch's HEAD is first
merged into `master` and then into `develop`. It is not the resulting new
merge commit from `master` that is merged back into `develop`. This means
that a linear path from the new `develop` branch to the new `master` commit
is not created. Even worse, a linear path is created from the new `develop`
branch to the *previous* `master` commit. Although unintended, this is
simply an effect of using the current branching rules.
When using `git-describe` in these cases, you can get very confusing and
misleading results, since `git-describe` scans the current commits linear
history for the most recent tag it finds, which will always be the *previous*
tag.
I will change this behaviour in the next version of the branching model
explicitly and I will include this behavioural change in the first version of
the Python rewrite.
For more references to this problem, see:
- Issue [#49](http://github.com/nvie/gitflow/issues/49)
- These
[two](http://groups.google.com/group/gitflow-users/browse\_thread/thread/9920a7df3d1c4908/0bb18a0bf7275ad6#0bb18a0bf7275ad6)
[discussions](http://groups.google.com/group/gitflow-users/browse\_thread/thread/19efac724bb6418a)
on the [git-flow-users](http://groups.google.com/group/gitflow-users)
mailinglist.
* **I'm getting errors when I use flags with git-flow!**
`git-flow` uses the [shFlags](http://code.google.com/p/shflags/) library to
provide platform independent flag parsing (using wichever low-level flag
parsing libraries like `getopt` or `getopts` are available). However,
`shFlags` does not work too well on a few platforms that haven't been tested
originally. This results in errors like this:
flags:WARN getopt: option invalide -- 'f' -- 'init' flags:FATAL unable to parse provided options with getopt
The platforms that suffer these errors include:
- Gentoo
- Ubuntu
- Redhat Enterprise Linux
There are open issues related to this:
[#28](http://github.com/nvie/gitflow/issues/28) and
[#39](http://github.com/nvie/gitflow/issues/39). Unfortunately, there is no
simple fix for it and all hope is placed on the Python rewrite of `git-flow`,
see issue [#33](http://github.com/nvie/gitflow/issues/33).
* **Can I use it with Windows?**
There have been reports of Windows users using `git-flow`.
<del>Un</del>fortunately, I have no Windows environment to test it on, but
this [issue](http://github.com/nvie/gitflow/issues/issue/25) should be
helpful in setting it up.
See the [FAQ](http://github.com/nvie/gitflow/wiki/FAQ) section of the project
Wiki.
Please help out
...
...
@@ -149,14 +137,6 @@ invited to contribute back your modifications to the community, preferably
in a Github fork, of course.
Typical usage:
--------------
For the best introduction to get started to `git flow`, please read Jeff
Kreeftmeijer's blog post:
[http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/](http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/)
### Initialization
To initialize a new repo with the basic branch structure, use:
...
...
git-flow-feature
View file @
1ffb6b10
...
...
@@ -170,22 +170,20 @@ name_or_current() {
fi
}
parse_
cmdline
() {
parse_
args
() {
# parse options
FLAGS "$@" || exit $?
eval set -- "${FLAGS_ARGV}"
}
parse_args() {
parse_cmdline "$@"
# read arguments into global variables
NAME=$
(last_arg "$@")
NAME=$
1
BRANCH=$PREFIX$NAME
}
parse_remote_name() {
parse_cmdline "$@"
# parse options
FLAGS "$@" || exit $?
eval set -- "${FLAGS_ARGV}"
# read arguments into global variables
REMOTE=$1
...
...
git-flow-hotfix
View file @
1ffb6b10
...
...
@@ -65,7 +65,7 @@ cmd_list() {
warn ""
warn "You can start a new hotfix branch:"
warn ""
warn " git flow hotfix start <
name
> [<base>]"
warn " git flow hotfix start <
version
> [<base>]"
warn ""
exit 0
fi
...
...
@@ -124,7 +124,7 @@ parse_args() {
eval set -- "${FLAGS_ARGV}"
# read arguments into global variables
VERSION=$
(last_arg "$@")
VERSION=$
1
BRANCH=$PREFIX$VERSION
}
...
...
git-flow-init
View file @
1ffb6b10
...
...
@@ -37,7 +37,7 @@
#
usage() {
echo "usage: git flow init [-f]"
echo "usage: git flow init [-f
d
]"
}
parse_args() {
...
...
@@ -49,8 +49,9 @@ parse_args() {
# Default entry when no SUBACTION is given
cmd_default() {
DEFINE_boolean force false 'force setting of gitflow branches, even if already configured' f
DEFINE_boolean defaults false 'use default branch naming conventions' d
parse_args "$@"
if ! git rev-parse --git-dir >/dev/null 2>&1; then
git init
else
...
...
@@ -68,6 +69,10 @@ cmd_default() {
local branch_count
local answer
if flag defaults; then
warn "Using default branch names."
fi
# add a master branch if no such branch exists yet
local master_branch
if gitflow_has_master_configured && ! flag force; then
...
...
@@ -101,9 +106,13 @@ cmd_default() {
fi
done
fi
printf "Branch name for production releases: [$default_suggestion] "
read answer
if noflag defaults; then
read answer
else
printf "\n"
fi
master_branch=${answer:-$default_suggestion}
# check existence in case of an already existing repo
...
...
@@ -146,7 +155,11 @@ cmd_default() {
fi
printf "Branch name for \"next release\" development: [$default_suggestion] "
read answer
if noflag defaults; then
read answer
else
printf "\n"
fi
develop_branch=${answer:-$default_suggestion}
if [ "$master_branch" = "$develop_branch" ]; then
...
...
@@ -216,7 +229,11 @@ cmd_default() {
if ! git config --get gitflow.prefix.feature >/dev/null 2>&1 || flag force; then
default_suggestion=$(git config --get gitflow.prefix.feature || echo feature/)
printf "Feature branches? [$default_suggestion] "
read answer
if noflag defaults; then
read answer
else
printf "\n"
fi
[ "$answer" = "-" ] && prefix= || prefix=${answer:-$default_suggestion}
git config gitflow.prefix.feature "$prefix"
fi
...
...
@@ -225,7 +242,11 @@ cmd_default() {
if ! git config --get gitflow.prefix.release >/dev/null 2>&1 || flag force; then
default_suggestion=$(git config --get gitflow.prefix.release || echo release/)
printf "Release branches? [$default_suggestion] "
read answer
if noflag defaults; then
read answer
else
printf "\n"
fi
[ "$answer" = "-" ] && prefix= || prefix=${answer:-$default_suggestion}
git config gitflow.prefix.release "$prefix"
fi
...
...
@@ -235,7 +256,11 @@ cmd_default() {
if ! git config --get gitflow.prefix.hotfix >/dev/null 2>&1 || flag force; then
default_suggestion=$(git config --get gitflow.prefix.hotfix || echo hotfix/)
printf "Hotfix branches? [$default_suggestion] "
read answer
if noflag defaults; then
read answer
else
printf "\n"
fi
[ "$answer" = "-" ] && prefix= || prefix=${answer:-$default_suggestion}
git config gitflow.prefix.hotfix "$prefix"
fi
...
...
@@ -245,7 +270,11 @@ cmd_default() {
if ! git config --get gitflow.prefix.support >/dev/null 2>&1 || flag force; then
default_suggestion=$(git config --get gitflow.prefix.support || echo support/)
printf "Support branches? [$default_suggestion] "
read answer
if noflag defaults; then
read answer
else
printf "\n"
fi
[ "$answer" = "-" ] && prefix= || prefix=${answer:-$default_suggestion}
git config gitflow.prefix.support "$prefix"
fi
...
...
@@ -255,7 +284,11 @@ cmd_default() {
if ! git config --get gitflow.prefix.versiontag >/dev/null 2>&1 || flag force; then
default_suggestion=$(git config --get gitflow.prefix.versiontag || echo "")
printf "Version tag prefix? [$default_suggestion] "
read answer
if noflag defaults; then
read answer
else
printf "\n"
fi
[ "$answer" = "-" ] && prefix= || prefix=${answer:-$default_suggestion}
git config gitflow.prefix.versiontag "$prefix"
fi
...
...
git-flow-release
View file @
1ffb6b10
...
...
@@ -121,7 +121,7 @@ parse_args() {
eval set -- "${FLAGS_ARGV}"
# read arguments into global variables
VERSION=$
(last_arg "$@")
VERSION=$
1
BRANCH=$PREFIX$VERSION
}
...
...
git-flow-version
View file @
1ffb6b10
...
...
@@ -36,7 +36,7 @@
# policies, either expressed or implied, of Vincent Driessen.
#
GITFLOW_VERSION=0.4
GITFLOW_VERSION=0.4
.1
usage() {
echo "usage: git flow version"
...
...
gitflow-common
View file @
1ffb6b10
...
...
@@ -44,18 +44,14 @@
warn() { echo "$@" >&2; }
die() { warn "$@"; exit 1; }
# argument processing
last_arg() {
if [ $# -ne 0 ]; then
shift $(expr $# - 1)
echo "$1"
fi
escape() {
echo "$1" | sed 's/\([\.\+\$\*]\)/\\\1/g'
}
# set logic
has() {
local item=$1; shift
echo " $@ " | grep -q " $
item
"
echo " $@ " | grep -q " $
(escape $item)
"
}
# basic math
...
...
@@ -148,7 +144,7 @@ git_compare_branches() {
git_is_branch_merged_into() {
local subject=$1
local base=$2
local all_merges=
$(git branch --no-color --contains $subject | sed 's/^[* ] //')
local all_merges=
"$(git branch --no-color --contains $subject | sed 's/^[* ] //')"
has $base $all_merges
}
...
...
@@ -219,7 +215,7 @@ gitflow_resolve_nameprefix() {
return 0
fi
matches=$(echo "$(git_local_branches)" | grep "^$
prefix$name
")
matches=$(echo "$(git_local_branches)" | grep "^$
(escape "$prefix$name")
")
num_matches=$(echo "$matches" | wc -l)
if [ -z "$matches" ]; then
# no prefix match, so take it literally
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment