-
Notifications
You must be signed in to change notification settings - Fork 17
Using GitHub
To ensure an uncomplicated collaboration on GitHub we have formulated some general guidelines for working with Git.
- For each developer development occurs on a local clone of the repository and is pushed to a development branch not the master branch
- Each user works on their own development branch. They should have a branch for each feature they are wishing to implement. This branch should contain the name of the user and also some information about the type of feature that is being implemented. After completing a feature and merging it this branch should be deleted to keep the number of open branches limited to active ones.
- A development branch is only merged with the master branch when it has been tested and deemed stable. This is always done using a pull request and needs to be reviewed before merging.
- Commits should always be given with an informative commit message e.g. 'besca initial commit of source code', 'update besca documentation', etc.
- New features that are being implemented need to be documented in git issues and assigned to the user working on them to ensure that everyone is up-to-date on what is being worked on.
An adherence to these guidelines will help ensure that we do not hinder each others work and work together productively.
- navigate to the location on your hard drive where you want to keep the local copy of the repository
- Clone the git repository into your repository.
git clone https://github.com/bedapub/besca.git
This automatically creates a directory called besca in the directory you cd
'd into previously.
On besca, we have three different branches including master and gh-pages. The gh-pages branch is only used for the documentation and should only be checked out when trying to build a more up-to-date version of the documentation. The process for checking out any of these branches is the same. Simple replace branch_name
with the correct name of the branch.
git checkout branch_name
Entering git status
will always tell you which branch you have currently checked out!
After developing new code you may wish to push your changes back to the dev branch on GitHub to store them for later. This ensures that 1. you have a backup of your code and 2. you can revert back to the old versions in case something goes wrong during development. This procedure works the same for all branches but in general, you should only be developing on the dev branch!
-
Check git status
This lets you see which files have been changed and helps you ensure that the correct branch is checked out.
git status
-
add the files you wish to commit.
git add [file list]
. (Alternatively, you can also usegit add --all
if you wish to commit all files that have changed.) -
commit your changes
git commit -m 'informative commit message'
-
Push your results
git push branch_name
You will be asked to enter your username and password for GitHub.
Once you have ensured that your development version is stable (see :ref:here <testing-besca-features>
) and want to make it available to everyone else you can merge your dev branch into the master branch. Before doing this you should ensure that all of your changes in the dev branch have been :ref:committed and pushed <testing-besca-features>
to GitHub.
- Navigate to
https://github.com/bedapub/besca/pulls <https://github.com/bedapub/besca/pulls>
_ and open a new pullrequest - have someone review the pull request
- merge the pull request