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

Numbers No Machine Can Reach

https://darkomulej.substack.com/p/numbers-no-machine-can-reach
1•Darius-BC•1m ago•0 comments

Auto Agent Protocol – open A2A profile lets AI agents talk to car dealerships

https://github.com/auto-agent-protocol/auto-agent-protocol
1•yankouskia•4m ago•0 comments

Resumes are dead, personal agents are next

https://www.cnbc.com/2026/04/30/these-2-job-seekers-built-ai-chatbots-to-talk-to-recruiters-for-t...
1•ogou•4m ago•1 comments

Show HN: Capture the Flag game where LLMs are the only players

https://github.com/Megapixel99/capture-the-flag
1•megapixel99•5m ago•0 comments

Met's Palantir deployment turns heat on its own officers

https://www.theregister.com/2026/04/30/met_police_palantir_deployment_cop_probe/
2•abdelhousni•5m ago•1 comments

DeepSeek: Thinking with Visual Primitives [pdf]

https://huggingface.co/datasets/NodeLinker/deepseek-ai-Thinking-with-Visual-Primitives-deleted-re...
3•krackers•7m ago•0 comments

A Prescription for Fixing the Prevailing Wage System [pdf]

https://ifp.org/wp-content/uploads/IFP_Prevailing_Wage_Experience_Benchmarking.pdf
1•rustoo•8m ago•0 comments

Neural surrogate experiments for physics simulation, automated with Opus and Cod

https://blog.1001ud.me/technical/experimental/physics-ml/neural-surrogates
1•lekan_digital•9m ago•0 comments

Benchmarking a Bug Scanner

https://blog.detail.dev/posts/bug-scanner/
1•drob•10m ago•1 comments

3D Tic Tac Toe

https://apps.apple.com/at/app/3d-ttt/id6763501981
1•franze•11m ago•1 comments

Silicon Valley Is Bracing for a Permanent Underclass

https://www.nytimes.com/2026/04/30/opinion/ai-labor-work-force-silicon-valley.html
2•reducesuffering•12m ago•0 comments

We Built AI Agents That Think, Shop, and Choose Like Real Consumers

https://sediman.com/research/ai-agents-consumer-research
1•JasonHEIN•12m ago•0 comments

You've Got (Too Much) Mail: Behind the Scenes of the 3/25/26 Voice Outage

https://discord.com/blog/behind-the-scenes-of-the-3-25-26-voice-outage
1•cyndunlop•12m ago•0 comments

Riviera – A Reverb plugin for DAWs that you can demo in the browser

https://riviera-demo.surge.sh/
1•stagas•14m ago•0 comments

U.S. Senators Vote to Ban Themselves from Trading on Prediction Markets

https://www.wsj.com/politics/policy/senators-vote-to-ban-themselves-from-trading-on-prediction-ma...
13•kamaraju•14m ago•2 comments

The debt crisis could cost average US household $18k/year

https://fortune.com/2026/04/30/national-debt-today-crisis-solutions-tax-brookings/
3•littlexsparkee•15m ago•1 comments

With AI, Your Internet History Is Attributable to You Personally

https://thecarrierwave.substack.com/p/with-ai-your-entire-internet-history
1•23j423j423hj•16m ago•0 comments

Belgium seeks nationalization of nuclear power plants

https://www.dw.com/en/belgium-seeks-nationalization-of-nuclear-power-plants/a-76993170
1•rustoo•16m ago•0 comments

LinkedIn scans for 6,278 extensions and encrypts the results into every request

https://404privacy.com/blog/linkedin-is-scanning-your-browser-extensions-this-is-how-they-use-the...
1•un-nf•16m ago•1 comments

How I built an Autonomous AI Agent team that runs 24/7

https://twitter.com/Saboo_Shubham_/status/2022014147450614038
1•rmason•17m ago•0 comments

Chernobyl, 40 Years Later

https://nautil.us/chernobyl-40-years-later-1280322
1•Brajeshwar•17m ago•0 comments

The HIPAA Violations Hiding in Your Team's Browser History

https://threegates.ai/blog/hipaa-violations-hiding-in-browser-history/
2•rndkeithw•17m ago•0 comments

Remix 3 Beta Preview

https://remix.run/blog/remix-3-beta-preview
2•pspeter3•21m ago•0 comments

Agentic Coding Is Burning Me Out – Sid's Blog

https://0xsid.com/blog/agentic-coding-fatigue
3•evo_9•21m ago•0 comments

CIA Ran MK-Ultra Experiments on Prisoners of War in Custody, Declassified Docs

https://theintercept.com/2026/04/26/mk-ultra-korean-war-prisoner-experiments/
3•pseudolus•22m ago•0 comments

YouTube has demonITised us. Here's what's next.[video; comments]

https://inv.nadeko.net/watch?__goaway_challenge=js-refresh&__goaway_id=ca717db49b8189092f97f7680d...
1•rolph•22m ago•0 comments

French prosecutors link 15-year-old to mega-breach at state's document agency

https://www.theregister.com/2026/04/30/french_gov_mega_breach_suspect/
1•Cider9986•24m ago•0 comments

Show HN: MCP Servers Can Fix the Biggest Problem with AI Coding Assistants

https://medium.com/@xcf.seetan/how-mcp-servers-can-fix-the-biggest-problem-with-ai-coding-assista...
1•xcf_seetan•24m ago•0 comments

A scar-tissue lessons library for Claude Code (compounds across projects)

https://github.com/tenxengineer/claude-code-enhance
1•tenxsengineer•25m ago•0 comments

Chinese Courts Rule Companies Cannot Fire Workers Simply to Replace Them with AI

https://www.caixinglobal.com/2026-04-30/chinese-courts-rule-companies-cannot-fire-workers-simply-...
4•vrganj•27m ago•0 comments