Git workflows

Confused about how to work with Git? You soon will not be confused, it is a well designed and versatile essential tool for remote development.

1. Comparing workflows

2. Gitflow architecture (also covered in article 1.)

Remote Development uses the Gitflow branching model. Simply put:

0. Initial steps
git init
git remote add origin git@softwareantelope.com/project-repo.git
git fetch

1. Developer checks out Master branch
git checkout master

2. Developer checks out a new feature branch
git checkout -b feature/my-new-feature

3. Developer work on and commits to feature branch

4. Developer pushes the feature branch to origin

First time:
git push -u origin feature/my-new-feature

Subsequently:
git push

5. Developer issues a pull request for the feature branch into Master

Simple?

The admin maintains the git repository, and collects ssh-keys (public) from each developer so that they can login to git@softwareantelope.com without a password.

The git admin checks the new feature branch, and notes any migrations that are required. When the PR is approved it is merged into the staging branch. Developers can now check their branches have been correctly merged into the staging branch and flags the branch as releasable if it does not cause issues.

At the end of the sprint, the admin builds a new server instance for live and switches to it after applying any updates. The staging branch is now merged with the Master branch. Developers can continue to work in their feature branches by merging master into their branch on the new sprint.

ANY FAILURE along the way is immediately notified to the admin so it can be fixed before it becomes a major exercise. Remember keep your branch atomic and up to date with the latest master.

Conflicts

Provided that developers work on separate concerns conflicts are kept to a minimum. Conflicts are resolved by the Admin using the simple “important branches first” principle.

Solo Developers

These rules apply to teams. They are also adhered to for developers who are single-handed on a project. It allows control, accountability, backup and many other advantages.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: