frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Git Commands That Cover 90% of a Developer's Daily Workflow

https://jsdev.space/15-git-commands/
29•javatuts•7mo ago

Comments

epmatsw•7mo ago
restore and maybe switch are the two missing ones I think. Rebase for me, but that’s preference. Cherry-pick too.
rentonl•7mo ago
my co-workers used to think I was an expert in git. In reality, they memorized 7 commands while I memorized 15
hbogert•7mo ago
i memorized that a commit tree is a ordered set of patches. Everything goes from there.
Areibman•7mo ago
In similar fashion, this site has saved me countless hours fixing common git issues https://ohshitgit.com
the__alchemist•7mo ago
I need to alias:

  git add .
  git commit -am "descriptive name"
  git push

to:

  git sync "descriptive name"
horsawlarway•7mo ago
personally - skip the 'git add .'

It's a pretty terrible habit to get into, and will (not can - will) cause all sorts of headaches. From minor ones like personal editor configs getting dumped into the projects, all the way up to major ones like secrets ending up in your git history.

If you want something close, but much better, do something like:

    if [[ -n $(git ls-files --others --exclude-standard) ]]; then
        echo "There are untracked files.  Please add, remove, or ignore them."
    else
        git commit -am "descriptive name"
        git push
    fi
the__alchemist•7mo ago
I see your point, but find it worth it for convenience. Ultimately git is a tool I use to get the job done, and I want it out of the way. 99% of the time, I just want to sync my project, which doesn't only mean edits to existing files.
open-paren•7mo ago
How about `git add --patch -all` to make it interactive? I have that aliased to `gap` and it is probably my most used git command.
cholantesh•7mo ago
That sounds better but I like the granularity I get from scrutinizing specific files or the patch takes too long to review.
speff•7mo ago
I'd like to suggest also mentioning `git add -p` (--prompt). It's very helpful for just adding changes relevant to the commit
nickcw•7mo ago
No `git rebase`?

Here are my stats for my last 300 or so git commands from my history

    $ history | grep git | awk '{print $3}' | sort | uniq -c | sort -rn

     71 log
     44 show
     34 diff
     26 co # alias for checkout
     24 cherry-pick
     23 status
     18 brs # alias for branch -v --sort=-committerdate
     13 rebase
     11 commit
     11 add
      8 push
      4 archive
      3 reset
      2 pull
      1 grep
      1 checkout
      1 br
Been doing lots of tricky merges recently hence all the cherry-picks! Not normally such a large part of my workflow.
mercer•7mo ago
For me, I generally don't go far beyond the commands in the article, but I /do/ make a lot of use of git rebase -i in my branches.
karmakaze•7mo ago
Maybe not essential, but reflog is invaluable.

I also like to separate fetch from pull (fetch + merge).

foobarkey•7mo ago
Remove merge and add rebase and we agree :)

Oh and maybe cherry-pick

seba_dos1•7mo ago
Both are essential.
realaleris149•7mo ago
There are other commands?
incomplete•7mo ago
also gonna echo the same sentiment: where's rebase? :)

two other git log commands i find to be insanely useful are:

alias hlog='git log --date-order --graph --date=short --format="%C(green)%h%Creset %C(yellow)%an%Creset %C(blue bold)%ad%Creset %C(red bold)%d%Creset%s"'

and:

alias alog='git log --date-order --all --graph --date=short --format="%C(green)%h%Creset %C(yellow)%an%Creset %C(blue bold)%ad%Creset %C(red bold)%d%Creset%s"'

this is great when working in a repo w/a main "prod" branch that you don't commit to directly, but instead commit to "staging" or "dev". alog shows you the entire repo's history for all branches, and hlog is just the graph of the non-pushable branches (plus all feature branches).

hbogert•7mo ago
i can't take this seriously if there's no mention of the '--amend' option and 'rebase' command
OutOfHere•7mo ago
It missed "git switch" and "git restore".

Zmij: Faster floating point double-to-string conversion

https://vitaut.net/posts/2025/faster-dtoa/
1•fanf2•30s ago•0 comments

Metot – Using LLMs for structural argument mapping (not just summarization)

1•hkcanan•7m ago•0 comments

Searching FusionAuth Users with Elasticsearch or OpenSearch

https://fusionauth.io/docs/lifecycle/manage-users/search/user-search-with-elasticsearch
1•mooreds•8m ago•0 comments

Show HN: PassDetective – Scan your shell history for leaked passwords and secret

https://aydinnyunus.github.io/2025/12/14/passdetective-kali-linux/
1•runtimepanic•8m ago•0 comments

Fixing the Flawed Colorado River Compact (2023)

https://eos.org/features/fixing-the-flawed-colorado-river-compact
1•mooreds•9m ago•0 comments

Words! Damned Words!

https://cutlefish.substack.com/p/tbm-395-words-damned-words
1•mooreds•9m ago•0 comments

How good is AI at solving Mac problems?

https://eclecticlight.co/2025/12/14/last-week-on-my-mac-how-good-is-ai-at-solving-mac-problems/
1•frizlab•10m ago•1 comments

Don't read x86 as eks-eighty-six anymore

https://cha86.dev/
1•uneven9434•11m ago•1 comments

A keyboard ring capable of alphanumeric output

1•SEMIPREMIUM•12m ago•0 comments

Show HN: Web demo of game engine for VNs – write the plot, get a playable game

https://talepad.com
1•wniak•13m ago•0 comments

Tier list of Linux security mechanisms (2024)

https://blog.ce9e.org/posts/2024-06-23-linux-security-mechanisms/
1•todsacerdoti•22m ago•0 comments

Show HN: WillItFront.Page – Test your HN post before submitting

https://www.willitfront.page/
2•tarasyarema•23m ago•0 comments

Show HN: PhotoToVideoAI – AI photo to video generator

https://phototovideoai.org
3•qzcanoe•28m ago•1 comments

The Lost Valley: Damming of Hetch Hetchy

https://worldhistory.substack.com/p/the-lost-valley
1•crescit_eundo•29m ago•0 comments

"You're Not Crazy": A Case of New-Onset AI-Associated Psychosis

https://innovationscns.com/youre-not-crazy-a-case-of-new-onset-ai-associated-psychosis/
2•xena•29m ago•0 comments

The battle for Warner Bros is a prelude to the real streaming war

https://www.economist.com/leaders/2025/12/11/the-battle-for-warner-bros-is-a-prelude-to-the-real-...
3•andsoitis•30m ago•1 comments

Implementing the TPC-H Benchmark in PicoLisp

https://picolisp.com/wiki/?tpch
1•Regenaxer•34m ago•0 comments

Automated Real-Time Pirate IPTV Blocking in France "Within Six Months"

https://torrentfreak.com/automated-real-time-pirate-iptv-blocking-in-france-within-six-months-251...
1•iamnothere•35m ago•1 comments

Illuminating the processor core with LLVM-mca

https://abseil.io/fast/99
3•ckennelly•37m ago•0 comments

Insurmountable Hans (or the era of turbocharged goalpost moving)

https://cjauvin.github.io/posts/insurmountable-hans/
2•cjauvin•38m ago•0 comments

Unexpected microbes are fixing carbon in deep ocean

https://www.nature.com/articles/s41561-025-01798-x
2•stevenjgarner•40m ago•1 comments

Show HN: I made a human-in-the-loop system for tuning LLMs in beta

https://www.joinoneshot.com/
1•gitpullups•40m ago•0 comments

Git history knows more than your standup. We built an AI to query it

2•slmslm•44m ago•0 comments

AI Photo Editor – Free Online AI Image Editor and Enhancer

https://ai-photo-editor.co
2•jacksteven•45m ago•0 comments

Why more than a quarter of Americans admit to stealing from self-checkout

https://www.marketplace.org/story/2025/12/11/why-are-people-stealing-from-selfcheckout
2•geox•46m ago•0 comments

Influenza viruses enter our cells [video]

https://www.youtube.com/watch?v=zx_6BZ7czBU
2•stevenjgarner•48m ago•1 comments

Using .gov Email Addresses for Age and Information Verification

https://blog.certisfy.com/2025/12/using-gov-email-addresses-for-age-and.html
1•Edmond•48m ago•0 comments

Show HN: claude-docs – dependencies –> reliable documentation references for CC

https://www.claudedocs.com/
1•OldOtter•48m ago•0 comments

The language that changed the world

https://www.economist.com/culture/2025/05/08/the-language-that-changed-the-world
1•andsoitis•48m ago•0 comments

Crypto Entrepreneur Who Caused 2022 Crash Is Sentenced to 15 Years in Prison

https://www.nytimes.com/2025/12/11/technology/crypto-do-kwon-sentenced-prison.html
2•bookofjoe•49m ago•1 comments