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

Comments

epmatsw•12mo ago
restore and maybe switch are the two missing ones I think. Rebase for me, but that’s preference. Cherry-pick too.
rentonl•12mo 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•12mo ago
In similar fashion, this site has saved me countless hours fixing common git issues https://ohshitgit.com
the__alchemist•12mo ago
I need to alias:

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

to:

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

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

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

Oh and maybe cherry-pick

seba_dos1•11mo ago
Both are essential.
realaleris149•12mo ago
There are other commands?
incomplete•12mo 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•11mo ago
It missed "git switch" and "git restore".

Gardens, Not Roads: Cultivating Open Source Communities

https://tarakiyee.com/gardens-not-roads-cultivating-open-source-communities/
1•g0xA52A2A•32s ago•0 comments

Peerloop – Review three products, get three reviews on yours

https://peerloop.xyz/
1•sssecasiu•9m ago•0 comments

HNSW vector search beyond available RAM for ESP32P4

https://github.com/brunokeymolen/nn20db-sdk
1•brunokeymolen•12m ago•1 comments

Great Paper: The Calculated Typer – Iowa Type Theory Commute Podcast S7 E6

https://pocketcasts.com/podcast/iowa-type-theory-commute/4c437000-eef8-0137-b700-0acc26574db2/gre...
1•matt_d•15m ago•0 comments

Show HN: Vaava – a baby routine tracker / logging app

https://www.vaava.app/
1•jkantola•18m ago•0 comments

WASM is not quite a stack machine

https://purplesyringa.moe/blog/wasm-is-not-quite-a-stack-machine/
1•signa11•22m ago•0 comments

TiddlyWiki v5.4.0

https://tiddlywiki.com/
2•Tomte•23m ago•0 comments

San Francisco, AI capital of the world, is an economic laggard

https://www.economist.com/finance-and-economics/2026/04/26/san-francisco-ai-capital-of-the-world-...
1•1vuio0pswjnm7•23m ago•0 comments

Cold Rush: Cooling Quantum Computers

https://www.science.org/content/article/helium-3-runs-scarce-researchers-seek-new-ways-chill-quan...
1•sudo_cowsay•24m ago•0 comments

Temporal Language Models

https://www.calcifercomputing.com/reports/tlm
1•oldfuture•26m ago•0 comments

QuickQWERTY: Touch typing tutor that runs in the web browser

https://codeberg.org/susam/quickqwerty
1•susam•28m ago•0 comments

Taylor Swift files to trademark voice and image after AI concerns

https://www.bbc.co.uk/news/articles/crm1mygrmv2o
2•austinallegro•29m ago•0 comments

Go is FIPS 140-3 certified

https://bsky.app/profile/filippo.abyssdomain.expert/post/3mkjbzbzxh62b
1•joonas•31m ago•0 comments

Personal Loan EMI Calculator – Check EMI Online – SMFG India Credit

https://www.smfgindiacredit.com/personal-loan-emi-calculator.aspx
1•saumyaraut11•37m ago•0 comments

Academics Need to Wake Up on AI, Part III

https://www.popularbydesign.org/p/academics-need-to-wake-up-on-ai-part-4c6
1•nedruod•38m ago•0 comments

Can Sam Altman be trusted? Musk wants a jury to answer the question

https://www.politico.com/news/2026/04/26/can-sam-altman-be-trusted-elon-musk-wants-a-jury-to-answ...
3•1vuio0pswjnm7•43m ago•2 comments

From Indiana to Idaho, a Backlash Against A.I. Gathers Momentum

https://www.nytimes.com/2026/04/27/technology/ai-artificial-intelligence-backlash.html
3•1vuio0pswjnm7•46m ago•0 comments

European Superheroes

https://europeisnotdead.com/european-superheroes/
1•hyperific•47m ago•0 comments

Show HN: Kplane – Virtual Kubernetes control plane

https://github.com/kplane-dev/kplane
1•lexokoh•47m ago•0 comments

Free Synastry Chart Calculator for Relationship Compatibility

https://synastrychart.org/
1•Jasonleo•51m ago•0 comments

Claude Code IDE – A Local Web IDE Wrapping Claude Code's CLI

https://github.com/Powellga/Claude-Code-IDE
1•greggapowell•52m ago•0 comments

Developer creates a FPS game using Gaussian Splats in browser

https://www.tomshardware.com/software/programming/developer-creates-a-basic-first-person-shooter-...
3•obilgic•57m ago•0 comments

Google Founder Leaves California Due to Socialism

https://www.foxbusiness.com/politics/google-co-founder-rips-california-billionaire-tax-i-fled-soc...
4•silexia•59m ago•1 comments

Three reasons why DeepSeek’s new model matters

https://www.technologyreview.com/2026/04/24/1136422/why-deepseeks-v4-matters/
3•thunderbong•1h ago•0 comments

Show HN: Cask.news – discover and track new homebrew Mac apps

https://cask.news/
1•to•1h ago•0 comments

I built a benchmark for testing LLMs playing Gomoku

https://github.com/homerquan/GomokuBench
1•homerquan•1h ago•0 comments

British cyclist takes KOM on San Francisco's steepest street with 41% gradient

https://www.bikeradar.com/news/harry-macfarlane-san-francisco-kom
1•littlexsparkee•1h ago•0 comments

Cheapest GPUs in the World

https://timlig.com/posts/cheapest-gpus-in-the-world/
1•anujsharmax•1h ago•0 comments

Meta Is Preparing to Have to Undo Its Manus Acquisition After China Ban

https://www.wsj.com/tech/ai/meta-is-preparing-to-have-to-undo-its-manus-acquisition-after-china-b...
2•thm•1h ago•0 comments

The AI Rug Pull

https://www.warman.life/blog/2026-04-27-the-apprenticeship/
3•shaunistyping•1h ago•0 comments