choderalab / software-development

A primer on software development best practices for computational chemistry
256 stars 76 forks source link

Version control software #1

Closed jchodera closed 7 years ago

jchodera commented 7 years ago

We should have a section on how to effectively use version control software, focusing on GitHub, since this has become the de facto standard many computational chemistry software tools.

bas-rustenburg commented 7 years ago

Version control with Git

Version control is important for maintaining the integrity of a software project. Tools like git, which is now the de facto standard for version control in most places, provide an interactive workflow environment for version control.

A version control system like git allows

On the user side, it provides a context manager, easily allowing you to switch between different versions of code, known as branches. It also provides a workflow for extending and modifying existing code: There are 4 steps to modifying code:

  1. branch the code, starting from the current state of the project
  2. add changes to it, enabling new features, or modifying existing ones
  3. commit, formally declare what changes you want to keep
  4. merge, putting your changes back into the original code base.

Online repositories:

To make collaborating on codebases with other developers easier, it is important to use a central repository service, such as Github, or Bitbucket. These websites provide a location to host your repository, and an interface to discuss and merge code collaboratively.

Github provides some easy guides on how to get set up with git and github for the management of your codebases.

https://guides.github.com/introduction/getting-your-project-on-github/

In a collaborative project, before merging, it is important to discuss with other colleagues whether the changes are appropriate. On github, this is done by means of a pull request.

Below is a basic description of a workflow that uses github.

https://guides.github.com/introduction/flow/index.html

bas-rustenburg commented 7 years ago

Another good guide:

https://www.atlassian.com/git/

bas-rustenburg commented 7 years ago

Anything you'd want to know about git is explained on this website:

https://git-scm.com/

bas-rustenburg commented 7 years ago

Projects that use github actively:

https://github.com/pandegroup/openmm https://github.com/numpy/numpy

jchodera commented 7 years ago

@bas-rustenburg : Can you spend ten minutes sweeping this into a markdown section with a PR on Friday?

bas-rustenburg commented 7 years ago

Done.