Geomario
3 min readFeb 28, 2021

--

Why GIT is used. (Git cheatsheet)

Why Git is used? With my everyday job as a Software Developer, I can tell you that GIT is used to manage software development in a better way.

P.S. I should tell you that not just software, everything, literally.

I encounter that working with GIT is a repetitive task. I, personally speaking, forget most of the time the commands. Therefore, I am providing the commands that I use the most for the last month's workings as a developer with a short explanation of the command. Use it wisely and enjoy it.

Why GIT is used?
  1. GIT clone

The command GIT clone provides you with a copy of another repository. This repository, located remotely, is downloaded with the command Git clone. GIT clone is basically the beginning of software development.

git clone <http://the-repository>

2. GIT status

You have to imagine that you have developed something over that code that you just cloned. You are not sure which files you have modified, and you want to check those files. This command is the one that tells you which are the modified files.

git status 

3. Git add

When you checked the files you modified and sure that this is the modification your code needed, you need git add. “Git add” adds the files that are ready to be committed.

git add -A

4. Git commit

You have cloned a code source; you have worked on it and add the changes. It is time to save them, right?. The command git commits does the job for you. Git commit saves the modification of the file and a little more. Because Git commit adds a small description of the modification, the modification should be written by you.

git commit -m "MESSAGE FOR MODIFICATION"

5. GIT push

After you worked enough in your source code, and you saved it. It is time to share it. For instance, I share my code with my colleagues on GitHub. Therefore, any change I made, I need to push it, literally. Because pushing the changes will replace the previous version of your code in the repository, yes, the same repository were you cloned it.

git push origin main

These are the basic five commands that every developer or data scientist should know by memory. I remember the first time I met Git, and I was confused that I hoped to have these readings.

The git command world is generous and amazing. I have faced several issues in git, for example, how to merge two different repositories into one? The more you dive into git, the more capabilities you find within the commands.

I personally enjoy to work with git; there is always something new to learn. I would recommend you follow me and look at my stories; I am sure you can find something interesting there.

Thanks for reading me. Can you give me a clap if you like the content? 👏🏼

Give it a try to my tutorials; I promise you, they are amazing. 📲

--

--

Geomario

👨‍💻 Software & Data Developer | Software Research Engineer | MLE