Day 8 Task: Basic Git & GitHub for DevOps Engineers.
Excercises
1.Create a new repository on GitHub and clone it to your local machine
create a repository my-first-repo-ex on github
create a file first.txt and enter any text and click on commit changes.
To get remote repository from remote server to local we use git clone it is used to make a copy of remote repository in local .
clone it to your local machine:
2.Make some changes to a file in the repository and commit them to the repository using Git
1.Navigate to your repository: Open a terminal and change to the directory of your Git repository.
2.Edit the file
first.txt file after making some changes.
3.Check the status:
4.Stage the changes:cUse the git add command to add the modified file to the staging area. The staging area is where you prepare the changes you want to commit.
5.Commit the Changes:
After adding the file to the staging area, use the git commit command to capture the changes in a snapshot and assign a message describing the changes.
3.Push the changes back to the repository on GitHub.
a.To push the changes back to the repository on GitHub, follow these steps:
-
b.check in github