Alternative - use subtree
For git experts.
The following instructions explain how to publish company_model
in your project folder’s ScopeFoundryHW
directory using Git.
We recommend the following folder structure, that be generated with ScopeFoundry.tools.
├── your_project_folder/
├── ScopeFoundryHW/
├── company_model/
├── company_model_hw.py
├── Licence
├── README.md
# optional
├── company_model_dev.py
├── company_model_test_app.py
├── .gitignore
├── docs/
├── links.json
├── ** more files/directories that make your hardware component work
**
We recommend using the following .gitignore
file, as it is generally not advisable to track measurement and log data:
# .gitignore
*.pyc
*.h5
*log*.txt
Initialize a Git repository locally (cd ScopeFoundryHW/{company_model}
):
git init --initial-branch=main
Commit your code. For the first commit, assuming you commit all files at once:
git add -A && git commit -m "Initial release"
Create the target repository on GitHub by prepending HW_
to the package name:
USER_NAME
.HW_{company_model}
.Push your code to the remote repository:
git remote add origin https://github.com/{USER_NAME}/HW_{company_model}.git
git branch -M main
git push -u origin main
This page periodically crawls GitHub for HW_*
repositories. It considers users/organizations that forked the ScopeFoundry repository. Your hardware repository will be found if:
HW_
.To clone an existing repo on GitHub into to your project’s hardware folder, navigate to your project folder (cd to/your_project_folder/
) and use the following command (requires Git):
git clone https://github.com/{THEIR_USER_NAME}/HW_{company_model}.git ScopeFoundryHW/{company_model}
Where {THEIR_USER_NAME}
and {company_name}
need to be replaced accordingly. Hint: The entries in the Library contain this line completed for the respective HardwareComponent.
Note: The HW_
prefix is removed in the target folder name.
If you plan to share changes you make to this code, it is wise to first fork the repository and then clone the forked version (see below).
If it is your repository, i.e you have write access, then simply push to it and you are done.
Otherwise:
USER_NAME
.Now you have a GitHub repository URL (with your USER_NAME
) of the form: https://github.com/{USER_NAME}/HW_{company_model}.git
.
Navigate to the folder of the hardware component:
cd to/your_project_folder/ScopeFoundryHW/{company_model}
Commit your code. To wrap all changes in one commit (not necessarily recommended):
git add -A && git commit -m "Describe your contribution"
Push your code to the remote repository:
git remote add origin https://github.com/{USER_NAME}/HW_{company_model}.git
git push -u origin
To share your contributions with the original owner, create a Pull Request on GitHub, and they can decide if they like to merge your contributions.
For git experts.
Package a HW component (for distribution with pypi).