Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
July 28, 2021 03:50 pm GMT

Basic Git commands for beginners

Hello everyone!!

I am Nirbhay Parmar and I am a learning web developer. In this post I will be explaining some basic Git terminologies which is useful if you are entering into development field or want to contribute in any open source project on Github.

Now the first question arises from this introduction is that what is Git and why should I even care about it? Some of the beginners are also confused between Git and Github. So let me explain the Git first then I will explain about Github after it.

Git is a version controlling software. It is used by developers for maintaining different versions of any project they are working on. In an ongoing development process there are many developers working on a single project. They are working with one or two features of that project. So they need a system that can keep track of the changes and commits made on a project and if someone broke the code while experimenting on any feature then there should a way to reverse that faulty code. So Git does the same. Git keep track on files and code used in a project and give a way to make different versions of same projects called "branches" to experiment without worrying about breaking the code.

Now what is Github? Github is a place to store your code or your repository online to share it with your team or online. All open source projects are on Github and any who knows how to code can contribute to it. Another such service are Bitbucket and Gitlab.

Now some basic Git commands-

  1. Git init - Git init is used to initiate a local git repository. It is first command whenever we want to use git.

  2. Git status - It shows the status of the working tree. Git status is used to show the changes made, any newly created file that is not added to repo.

  3. Git add - As the name suggests it used add new files and folders to git.

  4. Git commit - It is used to save changes to the repository.

  5. Git clone - It is used to setup a local git repo using any other remote git repo hosted on Github or Bitbucket.

  6. Git push - It is used to push commits to your remote repo.

  7. Git pull - It is used to fetch changes made by others to remote repo to your local repo.

So these are some common Git commands which we can use in your projects.

There are so many other commands which I will discuss in upcoming parts of this series.


Original Link: https://dev.to/nirbhayparmar/basic-git-commands-for-beginners-2bcb

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To