Committing (and pushing) your code
To add files to our repository so they are tracked, we need to create a commit. All committed changes are only kept in our disconnected local repository until we synchronize the changes with a remote repository using a git
push
command. Lucky for us, these are again very common actions, easily accessible from inside Visual Studio. This functionality is the equivalent of the git init
and git push
commands.
For Windows
Both pre- and post-16.8 versions of Visual Studio for Windows have similar steps for making a commit. Once items are staged, simply add a comment in the textbox near the top and hit the Commit Staged button:
Next, we just go to the Synchronization window and select Push to send our commit to the server.
For VS Code
It's a very similar process for Visual Studio Code. We go to the SOURCE CONTROL view, and in the Message box, we add our commit message.
Next,...