DEV Community

Cover image for Learning Git as a beginner - Tips
Adavize A.
Adavize A.

Posted on

Learning Git as a beginner - Tips

Learning how to work with a new tool as a beginner could be exciting, frustrating, or a mix of both. The concentration of that mix depends heavily on how you learn it.

In this article, I will share tips that helped while I was just learning Git.

Understand the why

Knowing the purpose of a version control system such as Git in a development environment will help you understand “what is going on” while learning. When you "git add" a file, what happens?

Focus on understanding Git itself at the initial stages of learning. Things like:

  • What does it mean to commit files?
  • When should I tell Git to ignore files?
  • What does it mean to pull changes? What are changes?.
  • What causes a merge conflict? What is done to resolve this?
  • Etc.

If these terminologies do not make sense to you yet, it is totally okay, just keep an eye out for them while learning.

See The Purpose of Git and GitHub in Development — A beginner-friendly explanation.

Get familiar with the terminal (Console, CLI)

illustration of a computer terminal
Most people who use computers today are comfortable with using graphical user interfaces. Although there are GUI options for Git, familiarity with the terminal is very helpful for software developers.
When starting out, you do not need to master how to use the terminal like a hacker; a basic understanding is enough.

Actions such as these can help you get comfortable with the terminal:

  • Basic file commands, e.g. create and navigate through directories, list files and folders in a directory, copy, move, delete etc.
  • Create and open files using the terminal, e.g. create a text file and open it with a text editor
  • Whatever feels right to practice with, just don't recursively delete your files.

When you are comfortable using the terminal, running Git commands shouldn’t be tough.

Avoid cramming commands, use a cheat sheet instead

With time and practice, the commands and their respective meanings gets easier to remember.

PS: There are a few basic commands that are helpful and important to remember, but don't go memorising all of Git's commands.
Using a "cheat sheet" helps— A list of commands with short descriptions for quick reference.

Also, searching the internet for things you don’t remember isn't a bad idea (we’ll get to this in the next heading).

Here’s a cheat sheet from GitHub education; please note that you can always make your simplified personal version - Git Cheat Sheet

GIYF

GIYF - “Google Is Your Friend” is a famous phrase in the ecosystem. If your favourite search engine works fine, that’s cool too.
Most bugs and issues you will face are probably somewhere on the internet, with solutions from people who have already overcome them.
It is helpful to dig the internet for answers, and I believe it is okay to look up what you don’t remember.

Remember to search using phrases of what you are trying to achieve, your error codes and messages etc.

Avoid getting stuck with a single learning resource

There are tons of learning resources out there. Some are good, and some are not so great.

You could be learning from books or videos, but wherever you’re learning from, if need be, check for alternatives that help you understand better.

Ask for help

Asking questions while learning helps make learning easier. But before asking I advise searching the internet first.

You could ask an online tech community, a local tech community, a more experienced friend, a mentor etc. Just be sure to structure your questions in ways that make it easy for people to understand and help out. Note that people have their schedules.

Here are helpful things to include while asking for help:

  • Where you’re coming from
  • What you’re trying to achieve
  • The problem you’re facing
  • Include error codes, error descriptions and other details that can help others understand your error
  • Include your attempts to resolve the issue if you’ve tried anything
  • Be sure to ask nicely, and leverage the magic words.

E.g. Hey, I cloned a repository, worked the files and committed my changes. Now when I try to push to the remote repository, I get the error “error here”. Can anyone tell me what’s wrong? Thanks.

Practice

We learn by doing! After taking Git tutorials and lectures, you need to put them into practice to master the knowledge you’ve gained.

Use Git to manage your personal and real-world projects; this will help you get familiar with the various scenarios that occur when working with Git.

Conclusion

I hope you find these tips helpful. May the force be with you <3

Top comments (0)