Day 9 Task: Deep Dive in Git & GitHub for DevOps Engineers.

Day 9 Task: Deep Dive in Git & GitHub for DevOps Engineers.

  1. What is Git and why is it important?

Git is a version control tool ,that allows you to version your file and code. So here for version control we can consider creation, deletion removal and modification in the code.

Here are some important handwritten commands by me (Git Related)

No alt text provided for this image

Now one thing we must remember that git add and git commit both are required to convert untracked file to tracked file.

No alt text provided for this image

let's deep into the stages of files in Git

- Working Directory - Git initiated working directory

- Staging Area - Files ready to get committed.

- Commit - Files committed to git repository.

2.What is difference Between Main Branch and Master Branch.

We can say that Main branch and Master branch are same. The default branch in git repository is master branch. But nowadays GitHub uses main as its default branch instead of master branch (i.e. Master is renamed as main). while others still use the master branch as a default branch.

No alt text provided for this image

We can define branch as a copy of master branch .Any project is saved on git is saved using commit and commit is identified using Commit ID.

A branch alwys points to latest commit.The pointer to latest commit is callled as head.

3.What is difference between local & remote repository? How to connect local to remote?

A local repository is a copy of a Git repository that is stored on your own computer, while a remote repository is a copy that is stored on a remote server or hosting service, such as GitHub.

4.Create a new file in Devops/Git/Day-02.txt & add some content to it

No alt text provided for this image

5.Push your local commits to the repository on GitHub

git push origin <Branch name>: The git push command is used to push local repository content to a remote repository.

git push origin master - used when branch is master

git pull <URL> - Used to pull changes into from repository.


Thank you so much for reading my article.

All suggestions are most welcome!

要查看或添加评论,请登录

Akanksha Patil的更多文章

社区洞察

其他会员也浏览了