Start software version control#
While this step is optional, it is highly recommended that you keep your bluesky instrument directory under some form of software version control. At minimum, this can provide some form of backup protection. It also helps others to collaborate with similar bluesky instruments by sharing your instrument’s implementations.
The installer program initializes a local git repository in the bluesky
folder. We now need to create a blank remote repository, for example
on GitHub or the APS GitLab server using your beamline organization.
Note that the bluesky team recommends GitHub. (Why is that? See section
Git Advice for APS beam lines for more info).
Note
APS beamlines use specific conventions for beamline organization.
Warning
To simplify the process (avoid merge conflicts), it is important for the remote repository to be empty. To do so, carefully follow the instructions described in the tabs below.
Follow the official GitHub instructions Create a repository with the modifications below:
- Do not select "Initialize this repository with a README" (skip step 5)
- Keep the other options as default:
- Visibility: Public
- Repository template: No template
.gitignore
template: None- License: None
Follow the official GitLab instructions Create a blank project with the modifications below:
- Visibility Level: Public
- Unselect "Initialize repository with a README"
- Keep "Enable Static Application Security Testing (SAST)" unselected
The next steps are common to both web-based repositories (GitHub and GitLab):
copy the remote repository URL, for example,
https://github.com/OWNER/REPOSITORY.git
open a terminal
$ cd ~/bluesky $ git remote add origin https://github.com/OWNER/REPOSITORY.git # Set a new remote $ git remote -v # Verify new remote > origin https://github.com/OWNER/REPOSITORY.git (fetch) > origin https://github.com/OWNER/REPOSITORY.git (push) $ git push -u origin main # Push repo to remote
For more information, you can refer to the official GitHub documentation:
which URL to use (
ssh
vshttps
): About remote repositoriesgit remote add
command: Adding a remote repositorygit push
command: Pushing to a remote repository