A commit is the basic unit of Git version history. It typically includes a commit message or description of the change, along with information about when the change occurred and who made it.

Making a Change

Click Show in Explorer to manage your local repository.
Your file manager will display all the contents of your repository. You can make changes to your file, rename it, or delete it entirely. When you reopen the Desktop App, you will be presented with the reflected change(s) in the Changes tab.
If you don't see your changes reflected in the Copia Desktop App, first make sure that you successfully saved your file.
If you realize you made a mistake, you can always discard your changes prior to committing them. To do this, navigate to the Changes tab, right-click on the change you wish to discard, and select the Discard changes... option.
Discarding changes will change the local file on your computer back to the previous version. Ensure that you are certain of this before discarding changes.
Copia recommends that you perform file renames separate from file changes. This is because Git only infers a rename operation based on whether a newly added file is similar to another file that was deleted. Simultaneously making changes and renaming in a single commit may result in the end of one file history and the start of a new one.


Committing a Change

Commits are often used to mark significant changes that you might want to look back on. You can think of them as meaningful, local changes that you can choose to store as a checkpoint. All commits you make will appear in the version history.
Commits that are especially significant can be used to create a tag. To learn more, check out the Tags and Releases section.
Once you're ready to commit in the Desktop App, navigate to the Changes tab and fill in the Summary and Description fields with information that outlines the changes reflected in that commit.
If you'd like to add a co-author to the commit, click on the icon in the lower left of the Description field. You might do this in certain use-cases where two engineers are working on code, but only one is saving changes to Copia. This allows you to attribute code changes to multiple users for future reference.
Press the Commit to Main button. This will store your change locally. You can make multiple changes and commit them before moving on.
While you can commit a single change and push it to remote, it's quite common to make multiple meaningful commits on your local branch and then push. To learn more about pushing commits, check out the Pushing section.

Amending a Commit (Amend Commit)

If you need to update a commit message or if you forgot to include changes in your commit, you might want to amend your commit. This action updates the most recent commit you have made in your current branch, prior to pushing the change.
To amend a commit, navigate to the History tab and right click on the most recent commit.
If you wanted to include additional changes, make them prior to amending the commit.
Update the Summary and Description fields to clarify the reason for the amend. Be sure to check any uncommitted changes that you would like to add to the commit. When finished, click the Amend last commit button.
You cannot amend a commit if you have already pushed a change. Doing so would alter the history on the Copia server and cause confusion for others who may have already pulled these changes.

Reverting a Commit (Revert Changes in a Commit)

In addition to amending a commit, you might want to revert a specific change. This allows you to remove that change from the top of the main branch.
Navigate to the History tab, right-click the commit you want to revert, and choose the Revert Changes in Commit button.
If you experience issues with reverting, first ensure that your IDE is closed.
Push the revert to remote by clicking the Push button. You can learn more about pushing in the next section.
You can only perform a revert after pushing if no subsequent commits have been performed.
If you require more guidance, we recommend that you review our video on reverting:

Retrieving a Commit (Checkout Commit)

If you would like to access the files of a previous commit, you can use the Checkout Commit feature.
Click into the History tab, right click on your commit, and select the Checkout commit option.
When you select this option, you revert to an older commit, meaning that your repository files and commit history will be temporarily reverted to the prior state. This state in Git is called a "Detached HEAD" and is treated as a temporary local branch. At this point, you can access your local repository and it will reflect the files at that commit point.
You can use this method to revert files to a prior state (or just for review) by either:
  1. 1.
    Making a copy of those files to later commit
    After copying the files to another location, you can cancel the Checkout by just switching back to the Main branch from the dropdown.
  2. 2.
    Creating a new Branch from the Detached Head and merging
    In the Branch dropdown, select the "New Branch" option, which will use the Detached HEAD as the revision for the new branch
To cancel the entire Checkout operation, simply switch back to the Main branch from the Branch dropdown.
If you require more guidance, we recommend that you review our video on commit checkout:

Restoring a Previous Commit (Restore from Commit)

If you would like to restore the files of a previous commit, you can use the Restore from Commit feature.
Click into the History tab, right-click on your commit, and select the Restore from Commit option.
If you already had changes in your working directory (i.e. your local repository folder), the Desktop App will warn you before overwriting those changes.
Once complete, the restore operation will update your local repository with the files from that previous commit. Navigate to the Changes tab and provide information for the Summary and Description fields. Once ready, press the Commit button. Your new commit will be reflected in the History tab.
We recommend that you incorporate the SHA and date of the prior commit into the commit message for traceability.

Viewing History

You can view your commit history in both the Desktop App and Web App.

Viewing History (Copia Desktop App)

Click the History tab in the top left corner the Desktop App. Changes from each commit will be rendered in the panel to the right.
To learn about how to manage your commit history, check out the Managing History section.

Viewing History (Copia Web App)

The history for your repository is also viewable in the Web App. Navigate to your repository and click on the Commits button. You will see a list of commits for that repository.
Last modified 5mo ago