Git
Using a version-control system (VCS) is highly recommended to keep track of the code that runs your experiment. This allows you to maintain a record of the software used to acquire data on specific experiment days. It also protects against accidental and untraceable changes to the code on your microscope that could affect data acquisition. The current recommended VCS for ScopeFoundry projects is Git.
Install Git
Windows
- Install Git using
conda install git
or by downloading and configuring SourceTree. - For newcomers, I recommend this YouTube tutorial.
Remember to configure your Git user information:
git config --global user.name "Nobody Nobinov"
git config --global user.email "nnobinov@example.com"
Start Your Main Repository
Let’s create a Git repository to store the code for the microscope app:
# cd "to/your_project_folder"
git init
Add files to the repository using:
git add fancy_app.py
Commit changes to the permanent history using:
git commit -m "cool changes happen here"
Sync with GitHub
It is recommended to sync changes to a free repository on GitHub.
After creating a new repository on GitHub named {USER_NAME}/{fancy_app}
, you will have a URL of the form: https://github.com/{USER_NAME}/{fancy_app}.git
.
To link your local repository to the one on GitHub:
git remote add origin https://github.com/{USER_NAME}/{fancy_app}.git
There are many tutorials online that explain how to use Git effectively, so we will not repeat that here.
Additionally, there are good graphical interfaces for Git that you may want to explore. One recommendation is SourceTree, which has a great tutorial.