DEV Community

Cover image for 7 Git Commands I Use Every Single Day
Caelora
Caelora

Posted on

7 Git Commands I Use Every Single Day

Git has hundreds of commands, but honestly, I only use a handful of them every day. These commands cover almost everything I need—from checking changes to syncing with remote repositories.

Here are my daily essentials.

1. git status

This is probably the command I run the most.

Before doing anything, I always check the current state of my repository.

git status
Enter fullscreen mode Exit fullscreen mode

It tells me:

  • Which files have changed
  • What's staged
  • What's untracked
  • Which branch I'm on

2. git diff

One habit that has saved me from countless mistakes is reviewing the actual changes before committing.

git diff
Enter fullscreen mode Exit fullscreen mode

If I've already staged files, I'll use:

git diff --staged
Enter fullscreen mode Exit fullscreen mode

Seeing the exact lines that changed helps catch accidental edits before they become part of the commit history.


3. git add

Once everything looks good, I stage the files.

git add .
Enter fullscreen mode Exit fullscreen mode

Or, if I only want specific files:

git add src/app.js
Enter fullscreen mode Exit fullscreen mode

4. git commit

Every commit should explain why the change exists.

git commit -m "Fix login validation"
Enter fullscreen mode Exit fullscreen mode

Small, focused commits make debugging and code reviews much easier.


5. git pull

Before starting new work, I make sure my local branch is up to date.

git pull
Enter fullscreen mode Exit fullscreen mode

This reduces merge conflicts later.


6. git push

Once everything is ready:

git push
Enter fullscreen mode Exit fullscreen mode

Simple, but one of the most satisfying commands after finishing a feature.


7. git log --oneline

Need to quickly review recent commits?

git log --oneline
Enter fullscreen mode Exit fullscreen mode

It's much cleaner than the default log and gives a quick overview of project history.


Final Thoughts

You don't need to memorize every Git command to be productive.

For me, these seven commands handle about 95% of my day-to-day Git workflow:

  • git status
  • git diff
  • git diff --staged
  • git add
  • git commit
  • git pull
  • git push
  • git log --oneline

I'm always curious to learn new workflows, though.

What's one Git command you use every day that you think more developers should know?

Top comments (0)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.