Git and Common Git Commands

By in
403
Git and Common Git Commands

What is Git?

Git is a version control system (VCS) that allows you to keep track of every dot and comma in your development folder structure. Version control is super important to know what changes are being made especially after the first release. Below we review Git and some common Git commands.

For example, let’s assume Version 1 of the code was “Hello World” and then someone is trying to make a change to it to “Hello Abc”. Then the git system looks at the change like the below figure.

Gti Version Control example

Everything that is being added is marked with Green color and everything that is removed is marked with Red color.

 

Common Git Commands

  • git init

Used to initialize the git repository.

  • git add .

Used to add all new files to the staging area.

  • git commit –message “Initial commit of White Gloves metadata”

Used to commit the changes.

  • git remote add origin https://github.com/YOUR_GITHUB_USERNAME/sfdx-project.git

Used to add the remote repository locally

  • git push origin master

Used to push the changes to the remote repository.

 

Conclusion

Version Controlling helps keep track of changes made to the code base. It also acts as a backup to your existing system in case something goes wrong after the deployment you can always revert the code back to the version that was working earlier.

 

Additional Resources

Cover Photo by Yancy Min on Unsplash

Leave a reply

Your email address will not be published. Required fields are marked *