Git - AADevTeam/docs GitHub Wiki
The Assessment team uses Git as the version control system. The repositories are hosted in Github.
Git
Installation
Installation steps for Windows can be found in this album.
Sample workflow
The following does not include commands used to do common tasks like stage and commit.
Suppose you have to implement feature x. First update your dev branch.
git checkout dev
git pull --rebase
Start working on a new feature branch.
git checkout -b feature-x
hack hack hack
From time to time, rebase your feature branch on the latest dev branch.
git checkout dev
git pull --rebase
git checkout feature-x
git rebase dev
Once the feature is complete, rebase the branch on dev (for small changes) or merge the branch to dev (for relatively large changes that took some time to complete). Then push the changes to the server.
git merge dev
git push origin dev
Branch policy
masterbranch should only contain code released to the customer. Therefore no one should regularly commit to this branch.uatbranch contains the staged code intended for customer release.devbranch is the busiest branch and the developers regularly commit to this. This can also be considered as the QA branch since the CI builds are done in this branch.- Users may create any other feature branches as preferred and push them to the server only necessary.
Merging
All the merges from dev to uat or uat to master branches should be non-fast-forward. This can be enforced by using the --no-ff option while merging.
However, it is recommended to rebase internal commits and keep a linear history. When pulling from the server, always use git pull --rebase unless there's a specific need.
Tagging
Tags should generally follow the specification described in Releases and versioning. It is allowed to have other special tags as required.
The dev branch is usually tagged automatically by the CI server. However, when merging from uat to dev, the merge commit should be manually tagged. Again, the conventions specified in Releases and versioning are to be followed.
All merges to uat and master should always be manually tagged.
Github
Github is used as the primary git server. There is a central user named AADevTeam which holds all the project repos. The basic workflow is that all users clone from this central repo, pull regularly and push their changes. Fork/pull request workflow is not used at the moment as this might add complexity and this one is more suitable for a small team.
Github wiki
We use the Github Wiki pages to store wiki content. The pages are written in Github-flavored markdown. Basics of the markdown syntax can be found here.
The wiki is located in the repo AADevTeam/docs.