Day 9 Task: Deep Dive in Git & GitHub for DevOps Engineers.
Git is?a free and open source distributed code management and Version control system?that is distributed under the GNU General Public License version 2. In addition to software version control, Git is used for other applications including configuration management and content management.
Git is a speedy that can handle projects of any size, from small to very large ones. Git provides cheap local branching, convenient staging areas, and multiple workflows. It is free, open-source software that lowers the cost because developers can use Git without paying money. It provides support for non-linear development. Git enables multiple developers or teams to work separately without having an impact on the work of others.
2. What is difference Between Main Branch and Master Branch??
There is no difference between main and master branch in git. Main or Master branch is a default branch when you create a repository. GitHub now use?main?as a it's?default branch. while others still use master branch as a default branch.
3. Can you explain the difference between Git and GitHub?
The difference between Git and GitHub:?Git is a widely used version control system that lets you manage and keep track of your code.?GitHub is a cloud-based hosting service that lets you manage your Git repositories. With GitHub, you can back up your personal files, share your code, and collaborate with others.
4. How do you create a new repository on GitHub?
5. What is difference between local & remote repository? How to connect local to remote?
Git local repository is?the one on which we will make local changes, typically this local repository is on our computer.
Git remote repositories are hosted on a server that is accessible for all team members.?
A git?remote command?is used to make the remote connections such as connecting a Git local repository with GitHub remote repository.
git remote add origin https://github.com/YOUR-USERNAME/YOUR-REPOSITORY
git push origin master
Tasks:
1.Set your user name and email address, which will be associated with your commits.
领英推荐
2.Create a repository named "Devops" on GitHub
3. Connect your local repository to the repository on GitHub.
The?git init?command transforms the current directory into a Git repository.
Here use?git remote?command to connect local repository to the GitHub repository.
git remote add origin <URL_from_GitHub_repository>
4.Create a new file in Devops/Git/Day-02.txt & add some content to it.
5.Push your local commits to the repository on GitHub
Git push?: The git push command is?used to upload local repository content to a remote repository.
git push origin master
Thank You for reading this Article.