Remote Repositories
The Remote Repositories under allows the user to view remote repositories linked to the site and options to pull and push to the listed remote repositories. It also allows the user to add a remote repository to the site.
Below, we have a site mysweetdotcom with a link to a remote repository in GitHub:
Add a Repository
To add a remote repository for your site, click on the New Repository button. A Create Repository dialog will open where you’ll need to fill in the required information then click on the Create button and you should see the new repository added in the Repositories
Note
For more information on errors that a user may encounter when using ssh keys with CrafterCMS, see Debugging SSH Key Issues
Pull from Repository
To get updates from the remote repositories, click on the down arrow next to the remote repository you would like to pull changes from
A dialog will open for pulling:
You will then be given some options for the merge strategy when Studio pulls from the remote repository by clicking on the dropdown:
Accept Ours: Accept the local’s version of the site and overwrite the remote version if different
Accept Theirs: Accept the remote’s version of the site and overwrite the local version if different
None: Studio will try to merge the remote version with the local version
Conflict Resolution
When performing a pull from remote repository, Git is usually able to merge changes from the remote repository to your local files. Sometimes, a line you edited in a file may have also been edited on the remote repository which will result in a merge conflict when you pull from the remote repository. In this case, you will have to step in and tell Git what to do. Crafter Studio supports resolving the conflict from the Remote Repositories
dashboard.
Note
Remember not to use Studio as a git merge and conflict resolution platform. All merge conflicts should be resolved upstream before getting pulled into Studio.
When you perform a pull from repository, and there’s a conflict between your local files and the remote repository files, the message Pull from remote failed
will appear:
After closing the error message by clicking the Ok
button, you will then be presented with options on how to resolve the conflict
In the next screen, you will be given the option to cancel the pull operation:
You will also be presented with options to resolve the conflict:
Accept Remote: accept the changes from the remote repository and discard your local changes
Keep Local: keep your local changes and discard changes from the remote repository
Diff: let’s you view the differences between your local files and the files in the remote repository. Crafter Studio let’s you view the differences a couple of ways:
Select the appropriate button for your case, Keep Local
or Accept Remote
then click on Confirm
. You will then be directed to commit the changes done to your local or cancel the pull operation.
When committing your changes, you will then be asked to supply a message for the repository history log and you’re done resolving the conflict
Push to Repository
To push your changes in Studio to a remote repository, click on the up arrow next to the remote repository you would like to push changes to
In the Push dialog, select the branch in the remote repository you’d like to push changes to