A Three Day Plan To Learn Git
By Sudheer S
When you begin your career in IT, you will be required to learn Git sooner or later. Git is a key technology used in everyday software engineering and DevOps. It has become persuasive and quintessential. There is no need to hard sell Git to anyone at this point.
There is a lot to learn about Git. The good news is that you can start with a subset of Git. There is a no need to become a Git master on your day one of software engineering or DevOps engineering. You can follow a tutorial and take home a Git workflow on day one. In about three days of studying and practising Git, you will be ready to use Git in software engineering and DevOps workflows.
Timeline
Here’s a rough outline of how you can learn Git in three days:
Day 1
Start by getting a basic understanding of what version control is and why it’s useful. You can do this by reading
online tutorials or watching videos. Then, learn about the core concepts of Git, such as commits, branches, and merging.
Install Git on your computer and set it up with your username and email. Create a local repository and start using Git
to track changes to your files.
Day 1 commands: git config
Day 2
Learn about remote repositories and how to push and pull changes from them. Create a remote repository (using a service such as on GitHub) and set it up to synchronize with your local repository. Learn how to fork and clone repositories. Practice collaborating with Git by working on a group project. If you can’t work with your colleagues yet, practice with friends.
Day 2 commands: git clone
, git fetch
, git pull
, git commit
, git push
.
Day 3
Learn more advanced Git techniques, such as rebasing and resolving merge conflicts. Practice using Git by working on a personal project or completing online exercises and challenges.
Squashing commits: Squashing commits is a way to condense multiple commits into a single commit. This can be
useful if you made a series of small, incremental commits and want to combine them into a single, more coherent commit.
To squash commits, you can use the git rebase -i
command, which allows you to specify which commits you want to squash.
Merging commits: Merging commits is similar to squashing commits, but instead of condensing multiple commits into
a single commit, it combines them into a single branch. This is useful when you have made separate sets of changes on
different branches and want to combine them into a single branch. To merge commits, you can use the git merge
command.
Day 4 And Beyond
Explore on your own. Make your own study plan. Fill your knowledge gaps. Take a structured Git course. Read a Git book. Every time you get an opportunity to improve your Git workflow, go for it.
As we strive to find our Ikigai, the intersection of our passion, mission, vocation, and profession, it’s important to constantly seek out ways to improve and optimize our workflows. And when it comes to version control and collaboration, Git is a powerful tool that can help us do just that. So every time you get the chance to enhance your Git workflow, don’t hesitate - seize the opportunity and watch your productivity and satisfaction soar as you bring your unique gifts to the world.
I recommend that you to take a course to learn Git. A course will provide a more comprehensive and structured learning experience. Don’t forget to get hands-on experience by working on projects and experimenting with Git on your own. This will help solidify your understanding of the concepts and give you the opportunity to apply what you have learned.
Git Commands For Day-To-Day Use
git init
: Initializes a new local repository.git clone <repository>
: Makes a copy of a remote repository onto your local machine.git add <file>
: Adds a file to the staging area, which means it will be included in the next commit.git commit -m "message"
: Commits the changes in the staging area to the local repository, with a message describing the changes.git push <remote> <branch>
: Pushes the specified branch to the specified remote repository.git pull <remote> <branch>
: Pulls the latest changes from the specified remote repository and merges them into the current branch.git branch <name>
: Creates a new branch with the specified name.git checkout <branch>
: Switches to the specified branch.git merge <branch>
: Merges the specified branch into the current branch.git rebase <branch>
: Reapplies the commits in the current branch on top of the specified branch.git diff
: Shows the differences between the files in the staging area and the latest committed version.git-rebase -i
: Git interactive rebase utility to squash and reorganize commits.git-commit --amend
: amend a previous commit. Used to amend commit messages and changes.
Try using these commands as you work through the learning plan. This will give you a chance to see how they work in action and help you get more comfortable using Git.
References
Resources
Structured Git Learning Resources
- Community maintained Git site: Git – everything is local
- Coursera Course: Getting Started with Git and GitHub
- Free Udemy Course: Git: Become an Expert in Git & GitHub in 4 Hours
- Atlassian Git Tutorials: Become a git guru.