Domino workspaces support Git in Git-based projects with CodeSync and imported Git repositories. You can use Git workflows like creating branches, committing your code, and pushing or pulling changes in a workspace.
You can use Git in a Git-based project with CodeSync in the following ways:
- Git service provider and workspace navigation pane
-
You can use your Git service provider’s user interface (such as GitHub) with Domino’s navigation pane actions such as Sync to Git, Sync to Domino, and Pull in a workspace. Domino recommends that you use Git in your project if you don’t have much experience using Git with a terminal and prefer a user interface. The rest of the screenshots in this topic demonstrates this method.
- A terminal in a Domino workspace
-
Start a terminal in your workspace and use Git just like you would on a local environment. For common workflows with Git, see the Git cheatsheet.
- Git plugins
-
Many IDEs integrate with Git or have plugins or extensions for Git.
These features are fully supported in Git-based projects through CodeSync technology and you can use them to interact with Git in Domino. See the following resources for information about how to use Git version control with your IDE:
-
Jupyter – Version control for Jupyter notebooks
-
RStudio – Managing GitHub and RStudio
-
VS Code – Version control in VS Code
-
Click File Changes in the navigation pane of your workspace.
-
Under Code, expand Uncommitted Changes to view changes.
The up (↑) arrow in the Code section indicates the number of commits that your branch is ahead of the upstream branch, while the down (↓) arrow indicates the number of commits that your branch is behind the upstream branch.
-
Enter a commit message.
-
Click Sync to Git.
Domino syncs and pushes your changes to the Git repository you’re using for your code.
-
Click File Changes in the navigation pane of your workspace.
-
Under All Changes, enter a commit message.
-
Click Sync All Changes. Domino commits changes to your code and syncs them to your Git repository, as well as commits changes to artifacts and syncs them to the Domino File System (DFS).
If you’re collaborating with others in a Git-based project with CodeSync, then you must pull the latest changes to your code from time to time.
-
Click File Changes in the navigation pane of your workspace.
-
Under the Code section, click Pull. Domino pulls the latest changes into your workspace.
You might encounter merge conflicts in your code when collaborating with colleagues. You can resolve merge conflicts in one of the following ways.
- Git service provider and workspace navigation pane
When merge conflicts arise, Domino will create a new branch with the conflicts in your repository and push them up to your Git service provider (that is, Github, Bitbucket, etc.). To resolve the conflicts:
-
Go to your Git service provider.
-
Using your Git service provider’s user interface, create a pull request between the newly created branch and your original branch.
-
Using your Git service provider’s user interface, merge the pull request.
-
Go back to Domino. Do not pull any changes.
-
Start a workspace terminal and reset the branch using
git reset --hard origin/name-of-branch
, wherename-of-branch
is the name of your original branch. -
Click Pull in the sidebar menu in your workspace. Domino will pull all the latest changes (that is, the resolved merge conflicts). Your branch should now be free of merge conflicts.
- A terminal in your workspace
If you prefer to work in a terminal, you can resolve merge conflicts from within a workspace terminal. If you’re not familiar with the typical Git workflow to resolve merge conflicts, Domino recommends Git merge conflicts.