Git :- A version control systems

Vicksheet Shanbhag
3 min readNov 5, 2022

--

Git is a free and open source software, which is used for tracking changes in your files of code. If you don't have that already installed in your system, you can install it from here.

Git allows you to have multiple branches that can be independent of each other. Creation , deletion, merging of branches can be done in seconds. All developers should have this installed and they should use it on daily basis.

When the developer starts working on any project, there initial task should be to initialise git for there project. Initial commit should be done in main branch. After that they should create a feature or bug-fix branch and start working on new features. Good practice would be to commit your changes on daily basis. Once any new feature is complete you can merge your new feature to main branch.

Git commands

These are few git commands which every developer should have this in mind.

  1. git init
    This command can be used to initialise the git for any project.
  2. git clone <clone URL>
    This command can be used to clone a repository from any origin like GitHub or Bitbucket.
  3. git checkout <branch name>
    This command can be used to checkout the code from any branches and we can switch between other branches.
  4. git branch
    This command can be used to check in which branch you are working.
  5. git pull origin <branch name>
    This command can be used to pull code changes from any branches from the current origin.
  6. git add . | git add *
    This command can be used after you have completed your code changes and you need to commit it to the branch from your local machine. It will will add all the changes to the git.
  7. git status
    This command can be used to check the status of your code changes, whether its added to the git or not. If any of the changes are not added to git those file paths will shown in red else added one will be in green.
  8. git commit -m “<commit message>”
    This command can be used to commit your changes in your systems git repository. This will automatically create one commit id, which we can use in future for tracking the changes.
  9. git log
    This command can be used to check the commit logs for your project. This will show all the details of the commit. If you want the details in oneline then you can append oneline to this command.
  10. git push origin <branch name>
    This command can be used when the commit is done and you want to push these changes to the online repositories in github or Bitbucket. Here specifying branch name is optional changes will be pushed to the branch which that was committed in the first place.

For more details you can visit the git documentation here.

Thank You!!!

--

--

Vicksheet Shanbhag
Vicksheet Shanbhag

Written by Vicksheet Shanbhag

I am a Software Developer and currently work as a Full Stack Developer. I like to research about new technologies and share any knowledge or tips that can help.

No responses yet