If you want to use Git workflows such as creating branches, committing code, and pushing or pulling changes in a workspace, you must use Git-based projects or imported Git repositories.
To use Git, you can:
If you prefer a user interface, or you do not have much experience using a terminal, you can use your Git service provider’s user interface (such as GitHub) with the actions in a Domino workspace’s navigation pane. Click on File Changes to perform actions such as Select and Sync (if configured in your environment), Sync to Domino, and Pull.
Start a terminal in your workspace and use Git just like you would in a local environment. See the Git cheatsheet for common workflows.
Many IDEs integrate with Git or have plugins or extensions for Git.
Domino’s Git-based projects fully support these features. You can use them to interact with Git in Domino. See the following resources for information about how to use Git with your IDE:
-
Jupyter – How to version control Jupyter Notebooks.
-
RStudio – Managing - Part 2 (GitHub and RStudio).
-
VS Code – Using version control in VS Code.
Note
|
In a Git-based project, the default working directory for your project’s code is |
Commit changes to your code and push them to your repository
-
Go to the workspace where you made changes to a file.
-
In the navigation pane, click File Changes.
-
In the Code section, 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. If your administrator enabled the option for you to select the changed files to commit, click Select and Sync.
-
If you clicked Select and Sync, select the files to sync.
-
Enter a commit message and click Sync to Git.
Domino syncs and pushes your changes to your Git repository.
Important
|
If you encounter merge conflicts when you pull or push code to your repository, see Resolve merge conflicts. |
You can use Domino to commit and push all changes to the project’s Git repository. This is often referred to as syncing your changes.
-
Go to your workspace.
-
In the navigation pane, click File Changes.
-
In All Changes, enter a commit message.
-
Click Sync All Changes. Domino commits changes to your code and syncs them to your Git repository. It also commits changes to artifacts and syncs them to the Domino File System (DFS).
Note
|
In a Git-based project, the default working directory for your project’s code is |
When you collaborate with others in Git-based projects, you must pull the latest changes to your code occasionally.
-
Go to your workspace.
-
In the navigation pane, click File Changes.
-
In the Code section, click Pull. Domino pulls the latest changes into your workspace.
Note
|
In a Git-based project, the default working directory for your project’s code is |
Important
|
If you encounter merge conflicts when you pull or push code to your repository, see Resolve merge conflicts. |
You might encounter merge conflicts when you collaborate with colleagues. To resolve merge conflicts, you can use the Git service provider or a terminal.
Resolve conflicts with the Git service provider
When merge conflicts arise, Domino creates a new branch with the conflicts in your repository and pushes them to your Git service provider (such as GitHub or Bitbucket).
-
Go to your Git service provider.
-
Use your Git service provider’s application to create a pull request between the newly created branch and your original branch.
-
Merge the pull request.
-
Return to Domino.
NoteDo not pull any changes. -
Start a workspace terminal.
-
Use the following to reset the branch:
git reset --hard origin/name-of-branch`
where
name-of-branch
is the name of your original branch. -
Click Pull. Domino pulls the resolved merge conflicts. Your branch is now free of merge conflicts.
Resolve conflicts with a terminal
If you prefer, you can resolve merge conflicts in a workspace terminal. For information about the typical Git workflow to resolve merge conflicts, see Git merge conflicts.