| ... | ... | @@ -10,11 +10,13 @@ ___ |
|
|
|
|
|
|
|
## Where to work
|
|
|
|
|
|
|
|
Always login as yourself (beamline or personal computer):
|
|
|
|
**Never work in the working directory** _ie_ current working version of beamline code used to run experiments.
|
|
|
|
For the old code, the working directory is /home/29IDUSER/Documents/User_Macros/Macros_29id/.
|
|
|
|
|
|
|
|
Login as yourself (beamline or personal computer):
|
|
|
|
- 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.
|
|
|
|
|
|
|
|
|
|
|
|
---------------------------------------
|
| ... | ... | @@ -32,11 +34,11 @@ Always login as yourself (beamline or personal computer): |
|
|
|
|
|
|
|
### Make your changes:
|
|
|
|
|
|
|
|
Commit changes regularly; think atomique commit (commit files one by one vs big all-together commit):
|
|
|
|
Commit changes regularly; think atomique commits (commit files one by one vs big all-together combined commit):
|
|
|
|
|
|
|
|
```
|
|
|
|
1. git status # check status to see a list of the files with changes
|
|
|
|
2. git add onefile # stage file for commit
|
|
|
|
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
|
|
|
|
```
|
| ... | ... | @@ -51,38 +53,31 @@ or, from VSCode: |
|
|
|
### When done for the day:
|
|
|
|
|
|
|
|
```
|
|
|
|
git push # push changes to GiHub
|
|
|
|
git push # push changes to GitLab
|
|
|
|
```
|
|
|
|
|
|
|
|
8. create pull request: on GiHub, click contribute
|
|
|
|
9. JM will review the changes; start over to step 1
|
|
|
|
On GitLab
|
|
|
|
- create pull request
|
|
|
|
- JM will review the changes and merge to main as needed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|

|
|
|
|

|
|
|
|
|
|
|
|
---------------------------------------
|
|
|
|
## Some tips:
|
|
|
|
|
|
|
|
Some tips:
|
|
|
|
|
|
|
|
- You can open more than one window in VSCode (I like to have a separate one for organization.md)
|
|
|
|
- To see preview of Mardown files (organization.md) side by side use extension “Auto-Open Markdown preview”
|
|
|
|
|
|
|
|
type Shift+cmd+X => this will open the extension marketplace; look for Auto-Open Markdown preview and install
|
|
|
|
|
|
|
|
- Only click once to open file from the side bar!
|
|
|
|
|
|
|
|
- You can open more than one window in VSCode
|
|
|
|
- To see preview of Mardown files side by side use extension “Auto-Open Markdown preview”: type Shift+cmd+X to open the extension marketplace; look for Auto-Open Markdown preview and install
|
|
|
|
- Only click once to open file from the side bar or it will open file as many time as you clicked (can be changed in settings)
|
|
|
|
- You can quickly end up with too many files open; you can use ”open editor” to close / reorganize
|
|
|
|
|
|
|
|
- You can see the list of functions and variables for a given file in “outline”
|
|
|
|
- collapse to see only the functions
|
|
|
|
- You can see the list of functions and variables for a given file in “outline”; collapse all to see only the functions
|
|
|
|
- Timeline shows commit messages for a given file
|
|
|
|
- The letter on the side of a files indicates uncommitted changes: M = modified; D = deleted; U = untracked (only for new files)
|
|
|
|
- The letter on the side of a files indicates uncommitted changes:
|
|
|
|
M = modified; D = deleted; U = untracked (only for new files)
|
|
|
|
- Each commit is identified by a unique 40 characters ID called called “sha”: typically only the first 6 to 8 character are displayed; this is a good way to check where you are
|
|
|
|
- To see the list of branch: git branch
|
|
|
|
|
|
|
|
more info: https://www.atlassian.com/git/tutorials/using-branches
|
|
|
|
|
|
|
|
- You might be able to create new branches and switch from one to another using the bottom icon; I haven’t played with it though:
|
|
|
|
- more info: https://www.atlassian.com/git/tutorials/using-branches
|
|
|
|
|
|
|
|
|
|
|
\ No newline at end of file |