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•10mo ago

Comments

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

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

to:

  git sync "descriptive name"
horsawlarway•10mo 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•10mo 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•10mo 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•10mo ago
That sounds better but I like the granularity I get from scrutinizing specific files or the patch takes too long to review.
speff•10mo 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•10mo 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•10mo 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•10mo ago
Maybe not essential, but reflog is invaluable.

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

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

Oh and maybe cherry-pick

seba_dos1•10mo ago
Both are essential.
realaleris149•10mo ago
There are other commands?
incomplete•10mo 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•10mo ago
i can't take this seriously if there's no mention of the '--amend' option and 'rebase' command
OutOfHere•10mo ago
It missed "git switch" and "git restore".

Activist Elliott Builds Big Stake in EDA Chip-Design Software Maker Synopsys

https://www.wsj.com/business/deals/activist-elliott-builds-big-stake-in-chip-design-software-make...
1•walterbell•35s ago•0 comments

The first modern rocket launched 100 years ago

https://theconversation.com/the-first-modern-rocket-launched-100-years-ago-beginning-a-century-of...
1•geox•3m ago•0 comments

Calm: LLMs That Predict Vectors Instead of Tokens

https://shaochenze.github.io/blog/2025/CALM/
1•IndignantTyrant•4m ago•0 comments

Show HN: Quillium, Git for Writers

https://quillium.bryanhu.com/
1•thatxliner•5m ago•0 comments

Crunchyroll's customer analytics data breached via outsourcing partner Telus

https://twitter.com/IntCyberDigest/status/2035864555805413448
1•badcryptobitch•8m ago•0 comments

Show HN: ClauseGuard – AI contract review in 90s, finds risks, writes redlines

https://www.theclauseguard.com
1•ebuyan•9m ago•0 comments

Show HN: Plot-Hole.com a daily movie puzzle I made

https://www.plot-hole.com/
1•captaincrunch•13m ago•0 comments

Migrating the American Express Payment Network, Twice

https://americanexpress.io/migrating-the-payments-network-twice/
1•madflojo•13m ago•0 comments

PewPew – real-time SSH attack visualizer, single Go binary

https://github.com/awakeelectronik/pewpew
2•awakeelectronik•22m ago•0 comments

How do we build production-ready AI systems?

https://docs.struere.dev
2•MarcoKueks•23m ago•6 comments

Men are losing a key chromosome with age and it may be deadly

https://www.sciencedaily.com/releases/2026/03/260319044711.htm
2•bookofjoe•23m ago•0 comments

Obesity may come in 11 different types, each with their own cause

https://www.newscientist.com/article/2488744-obesity-may-come-in-11-different-types-each-with-the...
1•paulpauper•25m ago•0 comments

Iconic Australian-made pinball machines preserved for generations to come

https://www.abc.net.au/news/2026-03-12/pinball-machines-collected-nfsa-hankin/105971386
3•gnabgib•33m ago•0 comments

What if Elon built a decentralized AI network?

http://heatmine.ai/
1•scharf•35m ago•0 comments

Plexus – Unified API gateway for multiple AI providers

https://github.com/mcowger/plexus
1•indigodaddy•36m ago•0 comments

How HN: A geometric framework for NP-Intermediate classes (OM Theory)

https://github.com/jumapama/OM-Theory-A-Geometric-Framework-for-NP-Intermediate-Classes
1•jumapama•38m ago•0 comments

AskAlf – Self-hosted AI workforce that runs 24/7

https://github.com/askalf/askalf
1•jsprayberry87•41m ago•0 comments

The deep cave bacteria resistant to modern medicine

https://www.bbc.com/future/article/20260318-the-deep-cave-bacteria-resistant-to-modern-medicine
1•Teever•41m ago•1 comments

Unlocking 25 Gigabit/S on 10 GbE Direct Attach Copper

https://kohlschuetter.github.io/blog/posts/2026/03/22/unlock25/
3•kohlschuetter•43m ago•0 comments

Privacy Respecting Age Controls

https://gist.github.com/devinvs/e334f7fb92f8d9b41b821a1dc8a46fde
1•devinvs•48m ago•1 comments

Health: Science Outran the System

https://juliahawkins.substack.com/p/health-how-science-outran-the-system
1•brandonb•48m ago•1 comments

The solar-powered compact car driving Tunisia's electric vehicle revolution

https://www.cnn.com/world/africa/electric-vehicle-solar-tunisia-spc
9•mooreds•59m ago•0 comments

Apply video compression on KV cache to 10,000x less error at Q4 quant

https://github.com/cenconq25/delta-compress-llm
4•polymorph1sm•1h ago•0 comments

The Onion's Exclusive Interview with Sam Altman

https://theonion.com/the-onions-exclusive-interview-with-sam-altman/
1•mooreds•1h ago•0 comments

Zprof – a comptime-configurable and minimal memory profiler for Zig allocators

https://github.com/ANDRVV/zprof
2•andrvv•1h ago•0 comments

VercelNet: The internet but only Vercel apps

https://vercelnet.vercel.app
1•aquajet•1h ago•0 comments

ForgeKV – Redis-compatible KV server in Rust that scales with cores

https://github.com/ForgeKV/forgekv
1•forgekv•1h ago•0 comments

Judge dismisses lawsuit by Sam Altman's sister accusing him of sexual abuse

https://www.reuters.com/legal/government/judge-now-dismisses-lawsuit-by-sam-altmans-sister-accusi...
2•Teever•1h ago•0 comments

Polsia Leaking Customers Secrets

https://twitter.com/NKCSS/status/2035760976377598252
3•NKCSS•1h ago•1 comments

Why I Vibe in Go, Not Rust or Python

https://lifelog.my/episode/why-i-vibe-in-go-not-rust-or-python
7•riclib•1h ago•2 comments