Branching and Merging#
Each project in Data Science & AI Workbench has its own repository that the files for the project are stored in. You can create branches off of your project to develop changes locally, then commit and push them to a remote collaborative project repository, where other users will then be able to pull your changes.
Creating a branch#
New branches are always created off of the currently active branch.
From the projects page:
Open your project and start a session.
Open the branch dropdown menu.
Click Create branch.
Provide a name for your branch.
Click Create.
Tip
The current active branch and its parent branch are always identified in the branch dropdown.
Switching between branches#
You can switch between branches that exist in your project using the branch dropdown menu.
Open the branch dropdown menu.
Select the branch you want to work in.
Caution
Your working branch must be clean to switch between branches. Commit and push your work before switching branches!
Note
You may need to refresh your editor view for it to detect the most recent changes.
Pushing changes to a branch#
Click the Commit and Push icon.
Select the files you want to commit to the remote branch from your local branch.
Enter a commit message for your changes.
If necessary, tag a version for your commit.
Click Commit and Push.
Merging changes to a parent branch#
When the changes on your branch are ready, you can merge them into the parent branch using the branch dropdown menu.
Open the branch dropdown menu.
Click Merge changes into parent branch.
Click Merge.
Pulling changes from a parent or remote branch#
If the parent or remote branch has changes applied to it that the active branch does not, you must pull the changes into your local branch to avoid merge conflicts before you push your commits.
Click the Pull icon.
Select the branch that contains changes you need to pull.
Open the Pull dropdown and select a pull method:
- Keep Theirs and Pull
Discards your local changes in favor of content on the parent branch. Your changes will be lost.
- Keep Mine and Pull
Discards changes on the parent branch in favor of your local changes. Changes on the parent branch will be overwritten.
- Keep Both and Pull
Saves the conflicting files with different file names so you can compare their content and decide how you want to reconcile the differences manually.
Deleting a branch#
There is currently no method for deleting a branch from the UI. This feature will be added in a later release. However, you can still delete branches from your project manually if necessary. To delete a branch from a project:
Open your project and start a session.
Open a terminal in your project session.
Run the following commands:
# Replace <BRANCH> with the name of the branch you want to delete git branch -D <BRANCH> git push origin :<BRANCH>
Caution
If you attempt to delete a branch that another user currently has active, the branch will not be deleted.