Working on code collaboratively can be a challenge. Managing multiple versions with different functionality can be especially difficult. Version control software allows us to manage collaborative software development by keeping track of different versions and who contributed to what. We will use Git, the most popular framework for version control, and GitHub, a site used to host and manage remote copies of your software.
It's important that you become familiar with how to use Git, as it will allow you to collaborate with your colleagues and contribute to meaningful analysis. You should be familiar with:
- Repositories
- the
add,commit,pushcommands - the
statuscommand - the difference between
branchesandforks pull requestsandissues- how Github integrates with repositories and the command line
Here are some basic tutorials you may want to follow:
- GitHub Hello World tutorial (highly recommended; concise but also text-heavy)
- GitHub Desktop Tutorial helpful to get started with a graphical user interface (GUI) rather than command line, if you're more comfortable with that. There is also a graphical interface on VSCode.
- Learn Git Branching (JS Applet) (optional; interactive and visual but perhaps too deep)
This Lab-Handbook allows you to make your own changes and push them to be integrated into the content. To do this, clone the repository to your local machine, make your changes, then add, commit and push:
git clone https://github.com/LevensteinLab/Lab-Handbook.gitgit checkout -b BRANCH_NAME(this creates a new branch calledBRANCH_NAMEand switches to it)- Make changes
git add .(the dot is code for "everything in this folder")git commit -m MESSAGE(replace the message with a one-sentence description of what you changed)git push origin BRANCH_NAME- Navigate to the
Lab-HandbookGitHub repository - You may see a yellow notification bar that indicates your branch is "ahead" of the main repository.
- Submit a pull request to integrate the changes into the final repository
- Dan will approve it