1. What is Git and why is it important?
Git is an open-source DevOps tool and also a distributed version control system. Git is used to track changes in the source codes, enable versioning and allow multiple developers to work together.
Before git developers used to keep their codes directly into the central server/repository without having copies of their own also there was a main problem with who made changes and when in the codes it was completely unknown to developers. But as Git is distributed version control in nature so many people can work concurrently on a single project. Every developer has a full copy of the repository, including the entire history of all changes. This makes it easier for developers to work together, as they don't have to constantly communicate with a central server to commit their changes or to see the changes made by others. Here, developers can do their work in offline mode too as they can keep a copy on their system, If the central repository goes down then there will be no chance of losing their data.
2. What is the difference Between Main Branch and Master Branch??
There is no particular difference between the two. main or master is the default branch when you create a repository. In GitHub when you create a branch by default it's set to main but you also can change it to master. Mainly GitHub changed the name from master to main as it sounds like a master-slave concept. Easy to remember as Git > Local > Master & GitHub > GUI > Main
3. Can you explain the difference between Git and GitHub?
Git and GitHub are not the same things, Git mainly works on local systems and is used to track changes in codes and enable versioning. Github is used to store code that is remotely centralized and most Developers use this to store their code. GitHub is the largest host of source code in the world.
4.How do you create a new repository on GitHub?
Go to your GitHub account (or Create one if you do not have any)
Click on the new repository option
Now give a name of your repository as per your choice and a description(optional)
Choose the Visibility to public /private as per your requirement.
Before hitting the create button you can include a README file
Click on Create button and a new repository will be created.
For More Information go visit my Hands-on Blog ->
kshitijaa.hashnode.dev/git-hands-on-1
5.What is difference between local & remote repository?
In Git, a local repository is a copy of the repository that is stored on your local machine (You can access & perform actions using Git Bash installed on your local machine), while a remote repository is a copy of the repository that is stored on a remote server, such as GitHub or GitLab.
The main difference between the two is that a local repository is accessible only on your local machine, while a remote repository can be accessed by multiple users and can be used for collaboration.
Whether it's a small team or a global community, Git and GitHub foster creativity and innovation in the world of software development. So, let the coding adventures begin!