Skip to content

Git Conventions

Janet Maldonado edited this page Oct 26, 2015 · 5 revisions

We are going to be using git flow mechanism within our repository management, for this purpose we have to branches in each project, master and develop.The master branch stores the official release history, and the develop branch serves as an integration branch for features. The workflow is described as follows:

1. Clone repository

Clone repository to a local folder in your computer and checkout develop branch.

$ git clone ssh://user@host/path/to/repo.git
$ git checkout -b develop origin/develop

2. Work on a story

Create a new branch for the current story or feature you are working. This branch should be based from develop branch:

$ git checkout -b some-feature develop

3. Merge with development branch

Make sure you merge dev branch before pushing changes and also be aware of resolving any merge conflicts you can encounter. We can use the git-up command line that we previously installed to update your branches all at once.

(some-feature) $ git-up
(some-feature) $ git merge dev

4. Commit your changes

Add meaningful comments to your commits so that is easier to find a certain change back in time. If your are working in a hot fix or bug add also issue tracking number.

(some-feature) $ git add 
(some-feature) $ git commit –m “Add meaningful comment in here for the changes you made”

5. Push your changes

Push your changes to repository with the following command

(some-feature) $ git push origin some-feature

6. Open a pull request

When you completed a feature or a user story open up a pull request to merge your feature branch with develop branch.

Go to the repository page on github. And click on "Pull Request" button in the repo header.

In the base branch drop down menu select develop, we always want to create a pull request to this development branch, not to master.

Compare and review your changes, here you can review all comments made on commits, identify which files changed, and get a list of contributors to your branch. When ready leave a description about the changes your branch contributes, click the create pull request button.

The pull request is sent immediately. You're taken to the main pull request discussion and review page. After your pull request is sent, any new commits pushed to your branch will automatically be added to the pull request. This is especially useful if you need to make more changes suggested by your code reviewer.

Clone this wiki locally