Skip to content

Instantly share code, notes, and snippets.

@virtualstaticvoid
Created August 16, 2011 09:44
Show Gist options
  • Select an option

  • Save virtualstaticvoid/1148742 to your computer and use it in GitHub Desktop.

Select an option

Save virtualstaticvoid/1148742 to your computer and use it in GitHub Desktop.
Git commands for maintaining a master, development and feature branches
[branch "master"]
mergeoptions = --no-ff --no-commit
[branch "development"]
mergeoptions = --ff-only
#!/bin/bash
####
# Git commands for maintaining a master, development and feature branches
#
##
# start working on a new feature
# from development, or master branch, assuming it is up to date
git checkout -b feature_name
##
# ... work on feature
git add .
git commit -m "feature sub task..."
##
# merge to development
# fast forward, so development has all commits
git checkout development
git merge feature_name --ff-only
# merge to master
# creates new commit on master with a message
git checkout master
git merge development -m "feature name added" --no-ff
@Chris927

Copy link
Copy Markdown

Tried it on the social_connections gem, works fine for me. My

~/.gitconfig

Looks as follows now, which seems to do allow me to not remember the merge options all the time:

[branch "master"]
    mergeoptions = --no-ff --no-commit
[branch "development"]
    mergeoptions = --ff-only

@virtualstaticvoid

Copy link
Copy Markdown
Author

You might want to put the .gitconfig file into the project directory, so that other repositories that don't follow the same convention aren't affected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment