Day 9 Task: Deep Dive in Git & GitHub for DevOps Engineers.
Akanksha Patil
DevOps Engineer @ Tata Consultancy Services | Azure Devops | Azure 3X Certified| Aws 1x Certified
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)
Now one thing we must remember that git add and git commit both are required to convert untracked file to tracked file.
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.
领英推荐
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
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!