Skip to content

Commit

Permalink
Merge branch 'develop' into feature/Issue50
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoramite committed Feb 8, 2012
2 parents d0df88d + 07dacd5 commit f66eba8
Show file tree
Hide file tree
Showing 9 changed files with 84 additions and 74 deletions.
2 changes: 2 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ Authors are (ordered by first commit date):
- Kiall Mac Innes
- Jon Bernard
- Olivier Mengué
- Emre Berge Ergenekon
- Eric Holmes

Portions derived from other open source works are clearly marked.
5 changes: 5 additions & 0 deletions Changes.mdown
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@
-----
Release date: **not yet**

* `git flow init` now detects situations where origin already has gitflow
branches set up, and behaves accordingly (thanks Emre Berge Ergenekon)

* `git flow feature finish` can now be called without a feature branch
name(prefix) argument and will finish the current branch, if on any.

* Various minor bug fixes related to internal argument passing

* Better support for Windows users.

* Add package installers for the Debian and Windows platforms.

0.4.1:
Expand Down
84 changes: 19 additions & 65 deletions README.mdown
Original file line number Diff line number Diff line change
Expand Up @@ -14,77 +14,14 @@ Kreeftmeijer's blog post:

Or have a look at one of these screen casts:

* [How to use a scalable Git branching model called git-flow](http://buildamodule.com/video/change-management-and-version-control-deploying-releases-features-and-fixes-with-git-how-to-use-a-scalable-git-branching-model-called-gitflow) (by Build a Module)
* [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
-------------------

### 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:

$ wget --no-check-certificate -q -O - https://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | sudo bash

### Windows

For Windows users, [msysgit](http://code.google.com/p/msysgit/) is a good
starting place for installing git.

#### 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:

$ wget -q -O - https://github.com/nvie/gitflow/raw/develop/contrib/gitflow-installer.sh | bash

#### Using [msysgit](http://code.google.com/p/msysgit/)
Download and install `getopt.exe` from the [util-linux package](http://gnuwin32.sourceforge.net/packages/util-linux-ng.htm) into `C:\Program Files\Git\bin`. (Only `getopt.exe`, the others util-linux files are not used). Also install `libintl3.dll` from the Dependencies package, into the same directory.

Clone the git-flow sources from GitHub:

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

Run the `msysgit-install` script from a command-line prompt (you may have to
run it with "Full Administrator" rights if you installed msysgit with its
installer):

C:\gitflow> contrib\msysgit-install.cmd

### 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:

$ sudo make install

By default, git-flow will be installed in /usr/local. To change the prefix
where git-flow will be installed, simply specify it explicitly, using:

$ sudo make prefix=/opt/local install

Or simply point your `PATH` environment variable to your git-flow checkout
directory.

*Installation note:*
git-flow depends on the availability of the command line utility `getopt`,
which may not be available in your Unix/Linux environment. Please use your
favorite package manager to install `getopt`. For Cygwin, install the
`util-linux` package to get `getopt`. If you use `apt-get` as your install
manager, the package name is `opt`.
See the Wiki for up-to-date [Installation Instructions](https://github.com/nvie/gitflow/wiki/Installation).


Integration with your shell
Expand Down Expand Up @@ -115,6 +52,23 @@ contributors, please see the [AUTHORS](AUTHORS) file.
Any questions, tips, or general discussion can be posted to our Google group:
[http://groups.google.com/group/gitflow-users](http://groups.google.com/group/gitflow-users)

Contributing
------------
Fork the repository. Then, run:

git clone --recursive git@github.com:<username>/gitflow.git
cd gitflow
git branch master origin/master
git flow init -d
git flow feature start <your feature>

Then, do work and commit your changes. **Hint**: ``export PATH=`pwd`:$PATH``
from within the gitflow directory makes sure you're using the version of
gitflow you're currently developing.

git flow feature publish <your feature>

When done, open a pull request to your feature branch.

License terms
-------------
Expand Down
8 changes: 4 additions & 4 deletions contrib/msysgit-install.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ echo getopt.exe... Found

if not exist "%GIT_HOME%\bin\git-flow" goto :Install
echo GitFlow is already installed.>&2
choice /C YN /M "Do you want to replace it"
if errorlevel 255 goto :Abort
if errorlevel 2 goto :Abort
if not errorlevel 1 goto :Abort
set /p mychoice="Do you want to replace it [y/n]"
if "%mychoice%"=="y" goto :DeleteOldFiles
goto :Abort

:DeleteOldFiles
echo Deleting old files...
for /F %%i in ("%GIT_HOME%\git-flow*" "%GIT_HOME%\gitflow-*") do if exist "%%~fi" del /F /Q "%%~fi"

Expand Down
4 changes: 3 additions & 1 deletion git-flow
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ if [ "$DEBUG" = "yes" ]; then
set -x
fi

export GITFLOW_DIR=$(dirname "$0")
# The sed expression here replaces all backslashes by forward slashes.
# This helps our Windows users, while not bothering our Unix users.
export GITFLOW_DIR=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")

usage() {
echo "usage: git flow <subcommand>"
Expand Down
9 changes: 7 additions & 2 deletions git-flow-feature
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ PREFIX=$(git config --get gitflow.prefix.feature)
usage() {
echo "usage: git flow feature [list] [-v]"
echo " git flow feature start [-F] <name> [<base>]"
echo " git flow feature finish [-rFk] [<name|nameprefix>]"
echo " git flow feature finish [-rFkD] [<name|nameprefix>]"
echo " git flow feature publish <name>"
echo " git flow feature track <name>"
echo " git flow feature diff [<name|nameprefix>]"
Expand Down Expand Up @@ -231,6 +231,7 @@ cmd_finish() {
DEFINE_boolean fetch false "fetch from $ORIGIN before performing finish" F
DEFINE_boolean rebase false "rebase instead of merge" r
DEFINE_boolean keep false "keep branch after performing finish" k
DEFINE_boolean force_delete false "force delete feature branch after finish" D
parse_args "$@"
expand_nameprefix_arg_or_current

Expand Down Expand Up @@ -346,7 +347,11 @@ helper_finish_cleanup() {


if noflag keep; then
git branch -d "$BRANCH"
if flag force_delete; then
git branch -D "$BRANCH"
else
git branch -d "$BRANCH"
fi
fi

echo
Expand Down
28 changes: 28 additions & 0 deletions git-flow-hotfix
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ usage() {
echo "usage: git flow hotfix [list] [-v]"
echo " git flow hotfix start [-F] <version> [<base>]"
echo " git flow hotfix finish [-Fsumpk] <version>"
echo " git flow hotfix publish <version>"
}

cmd_default() {
Expand Down Expand Up @@ -188,6 +189,33 @@ cmd_start() {
echo
}

cmd_publish() {
parse_args "$@"
require_version_arg

# sanity checks
require_clean_working_tree
require_branch "$BRANCH"
git fetch -q "$ORIGIN"
require_branch_absent "$ORIGIN/$BRANCH"

# create remote branch
git push "$ORIGIN" "$BRANCH:refs/heads/$BRANCH"
git fetch -q "$ORIGIN"

# configure remote tracking
git config "branch.$BRANCH.remote" "$ORIGIN"
git config "branch.$BRANCH.merge" "refs/heads/$BRANCH"
git checkout "$BRANCH"

echo
echo "Summary of actions:"
echo "- A new remote branch '$BRANCH' was created"
echo "- The local branch '$BRANCH' was configured to track the remote branch"
echo "- You are now on branch '$BRANCH'"
echo
}

cmd_finish() {
DEFINE_boolean fetch false "fetch from $ORIGIN before performing finish" F
DEFINE_boolean sign false "sign the release tag cryptographically" s
Expand Down
14 changes: 12 additions & 2 deletions git-flow-init
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,14 @@ cmd_default() {

# check existence in case of an already existing repo
if [ "$should_check_existence" = "YES" ]; then
git_local_branch_exists "$master_branch" || \
# if no local branch exists and a remote branch of the same
# name exists, checkout that branch and use it for master
if ! git_local_branch_exists "$master_branch" && \
git_remote_branch_exists "origin/$master_branch"; then
git branch "$master_branch" "origin/$master_branch" >/dev/null 2>&1
elif ! git_local_branch_exists "$master_branch"; then
die "Local branch '$master_branch' does not exist."
fi
fi

# store the name of the master branch
Expand Down Expand Up @@ -200,7 +206,11 @@ cmd_default() {
# default production branch and develop was "created". We should create
# the develop branch now in that case (we base it on master, of course)
if ! git_local_branch_exists "$develop_branch"; then
git branch --no-track "$develop_branch" "$master_branch"
if git_remote_branch_exists "origin/$develop_branch"; then
git branch "$develop_branch" "origin/$develop_branch" >/dev/null 2>&1
else
git branch --no-track "$develop_branch" "$master_branch"
fi
created_gitflow_branch=1
fi

Expand Down
4 changes: 4 additions & 0 deletions gitflow-common
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ git_local_branch_exists() {
has $1 $(git_local_branches)
}

git_remote_branch_exists() {
has $1 $(git_remote_branches)
}

git_branch_exists() {
has $1 $(git_all_branches)
}
Expand Down

0 comments on commit f66eba8

Please sign in to comment.