Skip to content

Instantly share code, notes, and snippets.

@israelst
Last active August 29, 2015 14:20
Show Gist options
  • Save israelst/2fe9ab0481d9be16f77b to your computer and use it in GitHub Desktop.
Save israelst/2fe9ab0481d9be16f77b to your computer and use it in GitHub Desktop.
This is a example to show a reduced version of gitflow. We are considering two remotes at local repository, the origin (fork) and the upstream (central):
(master) $ # starting a new task
(master) $ git pull --ff-only upstream master
(master) $ git checkout -b feature/new-task
(feature/new-task) $ # some coding
(feature/new-task) $ git add -p
(feature/new-task) $ git commit -m "The answer of all questions of the universe"
(feature/new-task) $ git push origin feature/new-task
(feature/new-task) $ # Do a pull request from feature/new-task to master and wait for coworker acceptance
(feature/new-task) $ git checkout master
(master) $ git pull --ff-only upstream master
(master) $ git brach -d feature/new-task
(master) $ git push --prune # Danger, vide help
# Merging a pull request with conflicts:
(master) $ # starting the merge
(master) $ git pull --no-ff coworks-repo feature/new-taks
(master) $ # some merge conflicts solving
(master) $ git add -p
(master) $ git commit
(master) $ git push upstream master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment