DEV Community

Cover image for Get to Know the Command Line: Basic Git Commands

Get to Know the Command Line: Basic Git Commands

Tori Crawford on January 06, 2020

A few weeks ago I started the “Get to know the Command Line” series with this Basic Commands article. This article that you are currently reading i...
Collapse
 
chintukarthi profile image
Karthikeyan Dhanapal

It's a great article. Just one thought from my side since you follow the order of git add, git commit and then git push, I wanted to say this:

If we are working on a shared repository and two or more people are working on it. So it would be a good practice to pull the latest code from the master before pushing our local changes. So that we will always be in sync with other's pieces of code too.

Collapse
 
torianne02 profile image
Tori Crawford • Edited

Thank you for adding such a great point.

I rearranged the order multiple times. I actually had it in the order you suggest and then changed it again last minute. As this is a post geared more towards beginners, I figured I'd try to explain the most basic commands first then touch on the ones that are used when pair programming/working with others. I didn't want to make things too complicated. That's why I did the last 3 commands together, since they are all geared towards working with others and are a tad more involved.

Collapse
 
sebring profile image
J. G. Sebring

Good one! Once you go console and learn the basics you'll never look back.

Setting editor of choice
I remember a fright of ending up in 'vi'-mode for commit messages. If you, like me, couldn't care less of learning how to use the vi-editor properly you should set git to fire the editor of your choice.

git config --global core.editor "notepad"

notepad, vs code ("code"), sublime, atom etc.

Collapse
 
manuelojeda profile image
Manuel Ojeda

Loved this guide for those who are newbs sing Git, awesome!

Collapse
 
danjconn profile image
Dan Conn

Awesome!