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

Comments

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

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

to:

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

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

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

Oh and maybe cherry-pick

seba_dos1•11mo ago
Both are essential.
realaleris149•11mo ago
There are other commands?
incomplete•11mo 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•11mo 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".

The Texas Lawyer and Part-Time Pastor Who Beat Meta and Google

https://www.wsj.com/us-news/law/the-texas-lawyer-and-part-time-pastor-who-beat-meta-and-google-82...
1•tolerance•4m ago•0 comments

ASML plans 1,700 job cuts as it restructures teams

https://www.techinasia.com/news/asml-plans-1700-job-cuts-as-it-restructures-teams
1•markus_zhang•5m ago•0 comments

The Blackwall Between Your AI Agent and Your Filesystem

https://www.wshoffner.dev/blog/greywall
1•ticktockbent•7m ago•0 comments

Boltcli – Bolt Food orders from the terminal (reverse-engineered API)

https://github.com/Lukynnnn/boltcli
1•Lukynnnn•10m ago•0 comments

PostMac – AI-native development, trunk-based Git, 12-factor philosophy

https://github.com/tdsanchez/PostMac
1•tdsanchez•11m ago•1 comments

Bob Dylan's AI "Lectures from the Grave" Review: An Accidental Warning

https://consequence.net/2026/03/bob-dylan-ai-lectures-from-the-grave-review/
1•coloneltcb•17m ago•0 comments

Error messages are an underrated part of agent experience

https://www.knut.fyi/blog/2026-03-30/agentic-developer-experience-starts-with-your-system
2•jeffinpdx•17m ago•0 comments

Ask HN: Anyone getting random quotes from U-Haul while their website is down?

1•phyzix5761•17m ago•0 comments

iOS 26.4 Autocorrect Updates

https://www.wsj.com/tech/apple-iphone-autocorrect-update-7659d618
2•daviesgeek•20m ago•0 comments

Show HN: HackerOne Silent-Patched My Critical BOLA and Banned Me

https://github.com/guardiankali/HackerOne-Silent-Patch-Exposed/blob/main/Critical.README.md
2•Salamalto•21m ago•0 comments

The Nginx default page hides 5 clues that lead to same 24-word BIP39 mnemonic

https://bip39-recast.pages.dev/wwwroot/
2•imcotton•23m ago•0 comments

Anarchist Calisthenics

https://harpers.org/archive/2012/12/anarchist-calisthenics/
2•theopsimist•24m ago•0 comments

They Believed They Found $500M in Civil War Gold. Then the FBI Swooped In(2025)

https://www.popularmechanics.com/adventure/a69762000/treasure-hunters-find-gold-fbi/
2•Jimmc414•26m ago•0 comments

Sedan (Nuclear Test)

https://en.wikipedia.org/wiki/Sedan_(nuclear_test)
2•JumpCrisscross•26m ago•0 comments

California Counties and Cities Comparison

https://trekhleb.dev/cali-vibe/
2•okso_app•28m ago•0 comments

Books and Screens

https://aeon.co/essays/what-we-think-is-a-decline-in-literacy-is-a-design-problem
3•bookofjoe•29m ago•0 comments

PocketMage PDA CrowdSupply

https://www.crowdsupply.com/talisman-design/pocketmage
2•caminanteblanco•29m ago•0 comments

StarRocks Is Not Enterprise Ready

https://dataengineeringguide.substack.com/p/starrocks-celerdata-not-enterprise-ready-2026
3•amandagerdes•30m ago•0 comments

Show HN: Codemaxxing – Maximize your slop abilities

https://github.com/jshchnz/codemaxxing
3•jshchnz•32m ago•0 comments

Long-Context Isn't the Answer

https://www.humanlayer.dev/blog/long-context-isnt-the-answer
2•arbayi•36m ago•0 comments

Wisp: WebAssembly Lisp

https://github.com/DavidLiedle/WISP
3•DavidCanHelp•36m ago•0 comments

Apollo's impatient old-timers are rooting for NASA's return to the moon

https://apnews.com/article/apollo-artemis-nasa-moon-6fd9cb210d40c59a729d5103c0994351
6•devonnull•37m ago•0 comments

FreeBSD Forums Hacked

https://mastodon.social/@nixCraft/116319158100665914
4•PortableCode•38m ago•0 comments

AI's capability improvements haven't come from it getting less affordable

https://www.lesswrong.com/posts/E6ELHguZFNF3Czp55/ai-s-capability-improvements-haven-t-come-from-...
2•gmays•40m ago•0 comments

OpenAI introduces a Codex plugin for Claude Code

https://twitter.com/reach_vb/status/2038670509768839458
4•adamfeldman•47m ago•1 comments

Discrete Norms, Stability Analysis, and the Lax Equivalence Theorem

https://natrask.github.io/ENM5320-2026/NewMaterial/Lecture03_Jan27/Lecture_4.html
2•measurablefunc•51m ago•0 comments

AI models sabotaging shutdown scripts. It took 22 years to regulate Meta

https://www.briancarpio.com/blog/ai-is-self-preserving-what-happens-in-22-years
3•linsys•51m ago•0 comments

Nous Research Hermes Agent launches Multi-agent

https://twitter.com/nousresearch/status/2038688578201346513
2•grafda•52m ago•0 comments

AI Leaders versus Elon Musk

https://www.axios.com/2026/03/30/elon-musk-openai-altman-anthropic
2•doener•52m ago•0 comments

Notes on Going Solo

https://www.joanwestenberg.com/notes-on-going-solo-celebrating-6-years-of-studio-self/
3•exolymph•55m ago•0 comments