# gt save

This command will execute the following actions under the hood:

First it runs:

$  git add .

This tells git to include the changes within all the files in your repository to your next commit. These changes include any modifications to your previously saved files and any new (untracked) files.

Next, in order to actually save the changes to the project’s history gitutor runs:

$ git commit -m “your message” 

You can think of a commit as a checkpoint or a snapshot of your repository’s current state. It’s important to notice that this command only saves the changes to your local repository.

Then we need to check if there are any changes in the remote repository with:

$ git pull

This updates your local repository with the remote changes. Git will try to merge the files but if there is a conflict a message will be prompted indicating which files have the conflict. You’ll need to solve all the conflicts manually and then run gt save again.

Finally, if there are no conflicts, you’ll be able to upload your local commits, or checkpoints, to your remote repository. To do this, gitutor runs:

$ git push

As you can see, if you wanted to use git to save your changes in the local and remote repository, you would have to run these 4 commands every time. Instead “gt save” does all of this for you with only 1 command.

# Options

This commands offers two optional flags:

# -m

gt save -m "your commit message"

This flag tells gitutor to use the message introduced in the command directly instead of prompting the user for one.

# -l

gt save -l

This flag tells gitutor to only save the changes in your local repository. This way nothing is modified in your remote repository.