Day 8: Basic Git & GitHub for DevOps Engineers.
What is Git?
GIT is a popular distributed version control system used for software development and is widely used by developers for managing source code and tracking changes made to it over time.
GIT allows multiple developers to work on the same codebase simultaneously and merge their changes together seamlessly. It also provides features for branching and merging code, enabling developers to work on separate features or fixes in isolation and then merge them back into the main codebase when they are complete.
GIT uses a decentralized architecture, which means that each developer has a complete copy of the codebase on their local machine, as well as access to the complete history of changes made to it. This makes it easy to revert changes, track down bugs, and collaborate with other developers.
What is Github?
GitHub is a web-based hosting service for software development projects that use the Git version control system.
GitHub provides a platform for developers to host, manage, and share their code with others. Developers can create and manage repositories, which contain the code for their projects, and use Git to track changes made to the code over time.
GitHub also provides features for collaboration, such as pull requests and code reviews, which allow developers to review and comment on each other's code before it is merged into the main codebase. It also provides tools for issue tracking and project management, enabling developers to keep track of bugs, feature requests, and other tasks related to their projects.
What is Version Control? How many types of version controls do we have?
Version control, also known as revision control or source control, is the management of changes made to computer code, documents, websites, or any other collection of information.
It allows multiple people to work on the same code base or document simultaneously, and track changes made over time, making it easier to collaborate and maintain a record of revisions.
There are two main types of version control systems:
2. Distributed version control system (DVCS): In a DVCS, every developer has a complete copy of the codebase or document on their local machine and there is no central server. Developers can work independently, making changes and committing them to their local repository. They can then synchronize their changes with other developers by pulling and pushing changes between repositories.
Why do we use distributed version control over centralized version control?
TASK : Install Git on your computer
2. install Git using the following command:
领英推荐
3. verify that Git has been installed by running the following command:
TASK: create free account on github
To create a free account on GitHub, follow these steps:
TASK : Create a new repository on GitHub and clone it to local machine, Make some changes to a file in the repository and commit them to the repository using Git also Push the changes back to the repository on GitHub
Steps to create a new repository on GitHub, clone it to your local machine, make changes to a file, commit the changes, and push them back to the repository on GitHub,
7. Navigate to the cloned repository directory by running the below command Replace the repository-name with actual name”?
8. Make some changes to a file in the repository using your favorite text editor
9. Run the below command to stage the changes,
Replace "file-name" with the name of the file you changed.
10. Commit the changes by running the following command,
Replace "Commit message" with a brief description of the changes you made.
11. Push the changes back to the repository on GitHub by running the following command
You may be prompted to enter your GitHub username and password.
These above commands will stage your changes, commit them to your local repository, and push them to the remote repository on GitHub.
.NET|.NET CORE | ASP.NET | MVC | SQL | WEB API | Micro services |GIT| Docker
1 年Nice