Getting started with git
In order to connect to your Modelbit git repository you need to upload an SSH key. Once a key has been uploaded, you can use modelbit clone
to clone the git repository to your local machine.
Adding a SSH key
To access your Modelbit git repo you'll need to add an SSH key. SSH keys work with Modelbit's git repositories the same as GitHub and Gitlab. To generate a key, run a command like:
ssh-keygen -t ed25519-sk -C "<comment>"
In Modelbit, open Settings and under User Settings click SSH Keys
.
Then click Add Key
in Modelbit. In the form, copy the contents of your key (e.g. ~/.ssh/id_ed25519.pub
) into the Key
box and give it a nickname like "Harry's Windows Box". Click Add Key
to save your SSH key in Modelbit.
For more help on generating SSH keys, see GitHub's SSH key documentation.
Cloning, pushing and pulling
With an SSH key uploaded to Modelbit you're now ready to clone your repository.
Use the modelbit
package and modelbit clone
to clone your workspace's git repository:
pip install modelbit
modelbit clone [target directory]
Once you have cloned the repository, all git commands including git pull
, git push
, and branch-related commands work as normal. Use git pull
to pull down the latest changes, and git commit
and git push
to check in changes.