commit changes and update repository
Overview
Assists in committing changes and updating the repository.
The steps for committing changes and updating the repository are described in the following order:
- Stage modified files
- Unstage files
- discard file changes
- Commit staged files
- Push committed changes
Stage the changed files
To stage your modified files:
For staging all files
Operation procedure
- Click the + button in the Changes folder in the Git navigator.
- Files listed under the Changes folder will be staged and a list of those files will be displayed in the Staged Changes folder.
When staging a specified file
Operation procedure
- Mouse over the file you want to stage under the [Changes] folder in the Git navigator.
- Click the [+] button that appears.
- The specified file is staged and appears in the Staged Changes folder.
Unstage files
To unstage a file, do the following:
If you want to unstage all files
Operation procedure
- Click the "-" button in the Staged Changes folder in the Git navigator.
- The files listed under the Staged Changes folder will be unstaged and a list of those files will be displayed in the Changes folder.
To unstage the specified file
Operation procedure
- Hover over the file you want to unstage under the Staged Changes folder in the Git Navigator.
- Click the [-] button that appears.
- The specified file is unstaged and appears in the Changes folder.
Discard file changes
To discard changes to a file and revert to the original file, follow these steps:
If you want to discard changes in all files
Operation procedure
- Click the [] button in the [Changes] folder in the Git navigator.
- The file changes displayed under the [Changes] folder are discarded and deleted from the [Changes] folder.
When discarding changes in the specified file
Operation procedure
- Mouse over the file whose changes you want to discard under the [Changes] folder in the Git navigator.
- Click the [] button that appears.
- Discards changes in the specified file and removes it from the Changes folder.
Commit staged files
To commit the staged files:
Operation procedure
- Set the commit message in the Commit message (Ctrl + Enter) text box in the Git navigator.
- Click the Commit button in the Git navigator.
- The files listed under the [Staged Changes] folder are committed, and the [Staged Changes] folder is deleted.
Revert last commit
If you commit a file by mistake, you can undo your previous commit by following these steps:
Operating procedure
- Click the three dots at the top of the Git navigator.
- From the menu that opens, click the Commit > Revert Last Commit button.
- The previous commit is undone and the changed files are reverted to their pre-commit state.
Push the committed changes
To push files that have been committed to your local repository to a remote repository, follow these steps:
Operation procedure
- Click the three dots at the top of the Git navigator.
- In the menu that opens, click the [Push] button.
- Push starts and completes after a certain amount of time.
About synchronizing with remote repositories
- Click the [Sync (Pull and Push)] button at the top of the Git navigator to sync with the remote repository.
Note that when you sync, you pull changes from the remote repository and merge them.