... | ... | @@ -11,7 +11,7 @@ ___ |
|
|
## Where to work
|
|
|
|
|
|
Always login as yourself (beamline or personal computer):
|
|
|
- set up VSC
|
|
|
- set up VSCode
|
|
|
- set up conda env / ipython config / startup etc
|
|
|
- clone repo to a local folder
|
|
|
- **do not work in the working directory** _ie_ current working version of beamline code used to run experiments.
|
... | ... | @@ -21,21 +21,39 @@ Always login as yourself (beamline or personal computer): |
|
|
## Workflow for code development
|
|
|
|
|
|
|
|
|
```
|
|
|
### Sync and create new branch:
|
|
|
|
|
|
1. git checkout main # switch to “main” branch
|
|
|
```
|
|
|
1. git checkout main # switch and/or make sure you are on the “main” branch
|
|
|
2. git fetch # check for changes of main repository
|
|
|
3. git pull # update your “main” branch to include changes from the day before
|
|
|
3. git pull # update your “main” branch to sync to remote repository
|
|
|
4. git checkout -b branchX # create new branch from “main” named branchX and switch to it
|
|
|
```
|
|
|
|
|
|
### Make your changes:
|
|
|
|
|
|
Commit changes regularly; think atomique commit (commit files one by one vs big all-together commit):
|
|
|
|
|
|
```
|
|
|
1. git status # check status to see a list of the files with changes
|
|
|
2. git add onefile # stage file for commit
|
|
|
3. git commit -m 'a comment' # commit the staged file with a commit message
|
|
|
4. git log # check commit message; start over to step 1 for next file
|
|
|
```
|
|
|
or, from VSCode:
|
|
|
|
|
|
1. stage file using + sign
|
|
|
2. enter commit message
|
|
|
3. commit file using checkmark
|
|
|
4. use curved arrow to undo changes
|
|
|
|
|
|
|
|
|
### When done for the day:
|
|
|
|
|
|
```
|
|
|
git push # push changes to GiHub
|
|
|
```
|
|
|
|
|
|
5. make changes
|
|
|
6. commit changes regularly; think atomique commit (vs big all together commit):
|
|
|
|
|
|
7. When done for the day:
|
|
|
git push # push changes to GiHub
|
|
|
8. create pull request: on GiHub, click contribute
|
|
|
9. JM will review the changes; start over to step 1
|
|
|
|
... | ... | |