Skip to content

Git development workflow

Wolfgang Hotwagner edited this page Jan 22, 2021 · 12 revisions

Contributing: git development workflow

The main-branch always represents the latest release. All development actions happen in the "development"-branch. The workflow for contributions is following:

  1. Fork the logdata-anomaly-miner repository
  2. Clone the forked repository to your development machine
  3. Create a feature branch
  4. Develop your feature and improvements in the feature-branch
  5. Fetch and merge from the upstream
  6. Push the changes to your github-repository
  7. Submit your pull-request
  8. Update your local development branch
  9. Update your development branch in your github-repository

git-workflow

1. Fork the logdata-anomaly-miner repository

Go to https://github.com/ait-aecid/logdata-anomaly-miner/ and click on fork.

2. Clone the forked repository to your development machine

After forking the repository into your own workspace, clone the development branch of that repository.

git clone -b development git@github.com:YOURUSERNAME/logdata-anomaly-miner.git

Alternatively you could create a development envrironment as described here..

3. Create a feature branch

Every single workpackage should be developed in it's own feature-branch. Use a name that describes the feature:

git checkout -b feature-jsonimporter

4. Develop your feature and improvements in the feature-branch

Please make sure that you commit only improvements that are related to the workpage you created the feature-branch for.

5. Fetch and merge from the upstream

If your work on this feature-branch is done, make sure that you are in sync with the development-branch of the upstream:

git remote add upstream git@github.com:ait-aecid/logdata-anomaly-miner.git
git fetch upstream development
git rebase upstream/development

If any conflicts occur, fix them and add them using "git add " and continue with the rebase with "git rebase continue"

Additional infos:

6. Push the changes to your github-repository

Before we can push our changes, we have to make sure that we don't have unnecessary commits. First checkout our commits:

git log

After that we can squash the last n commits together:

git rebase -i HEAD~n

Finally you can push the changes to YOUR github-repository:

git push

Additional documentation:

7. Submit your pull-request

Use the GitHub-Webinterface to create a pull-request. Make sure that the target-repository is ait-aecid/development.

If your pull-request was accepted and merged into the development branch got to "8. Update your local development branch". If it wasn't accepted, read the comments and fix the problems. Before pushing the changes make sure that you squashed them with your last commit:

git rebase -i HEAD~2

Delte your local feature-branch after the pull-request was merged into the development branch.

8. Update your local development branch

Update your local development branch:

git fetch upstream development
git checkout -b development
git rebase upstream/development

Additional infos:

  1. Update your development branch in your github-repository

Please make sure that you did "8. Update your local development branch" as described above. After that push the changes to your github-repository to keep it up2date:

git push