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".

Machine learning without critical thinking only encourages tech pseudoscience

https://www.skeptic.org.uk/2026/03/machine-learning-without-critical-thinking-only-encourages-tec...
1•donatzsky•2m ago•0 comments

Show HN: Bring your own prompts in SSH remote shells

https://github.com/tgalal/promptcmd
1•tgalal•3m ago•0 comments

Meta drops appeal against ruling requiring non-algorithmic social media timeline

https://nltimes.nl/2026/01/26/meta-drops-appeal-court-ruling-requiring-non-algorithmic-social-med...
2•jacquesm•3m ago•0 comments

Anthropic Sues Pentagon over 'Supply Chain Risk' Label

https://www.nytimes.com/2026/03/09/technology/anthropic-defense-artificial-intelligence-lawsuit.html
1•redm•3m ago•0 comments

Claude Code for Data Work

https://simplicityissota.substack.com/p/claude-code-for-data-work
1•bookish•4m ago•0 comments

Show HN: Sudokrypt – A brutalist GBC puzzle game with a custom 4x8 engine

https://leviwanner.itch.io/sudokrypt
1•a_bytecycle•4m ago•1 comments

Social media feed is built to agree with you. What if it didn't?

https://www.rochester.edu/newscenter/echo-chambers-meaning-social-media-politics-693662/
2•geox•6m ago•0 comments

Forge runtime: 41k lines of C# → 19k lines of C++ (~7× faster)

https://codeberg.org/CrowdWare/Forge4D/src/branch/main/news/performance.md
2•artanidos•8m ago•1 comments

AI chooses nuclear escalation in 95% of simulated crises

https://www.computerweekly.com/news/366639877/AI-chooses-nuclear-escalation-in-95-of-simulated-cr...
2•beardyw•9m ago•0 comments

How Print Design is the Future of Interaction (2011)

https://web.archive.org/web/20120314071640/http://kruzeniski.com/2011/how-print-design-is-the-fut...
1•mananaysiempre•9m ago•0 comments

Lessons learned using MedSigLIP (MedGemma) for dermatology

https://medium.com/@marcinstepien/lessons-learned-from-applying-medgemma-medsiglip-to-melanoma-de...
1•marcinstepien•9m ago•1 comments

Anthropic, Microsoft integrated tech behind Claude Cowork into M365 Copilot

https://www.microsoft.com/en-us/microsoft-365/blog/2026/03/09/copilot-cowork-a-new-way-of-getting...
1•Terretta•11m ago•0 comments

vLLM Semantic Router v0.2 Athena: ClawOS, Model Refresh, and the System Brain

https://vllm.ai/blog/v0.2-vllm-sr-athena-release
1•mariuz•14m ago•0 comments

James Bruton's new one-ball balance bike [video]

https://www.youtube.com/watch?v=tXzH9BSd5IU
1•kitd•15m ago•1 comments

Movie reconstruction from mouse visual cortex activity

https://elifesciences.org/articles/105081
2•_____k•16m ago•0 comments

The usability imperative for securing digital asset devices

https://www.technologyreview.com/2026/03/09/1132352/the-usability-imperative-for-securing-digital...
1•joozio•16m ago•0 comments

Ask HN: Identity preservation vs. information transfer in LLMs

1•PennyTee•18m ago•0 comments

After falling far behind the rest, Blue Origin creates new stock option plan

https://arstechnica.com/space/2026/03/after-years-of-missteps-blue-origin-to-finally-offer-meanin...
1•oldnetguy•18m ago•0 comments

Show HN: AI agent that runs real browser workflows

https://ghostd.io
2•heavymemory•19m ago•2 comments

Laser-Based 3D Printing Could Build Future Bases on the Moon

https://www.universetoday.com/articles/laser-based-3d-printing-could-build-future-bases-on-the-moon
1•oldnetguy•19m ago•0 comments

Do Offshore Wind Farms Pose National Security Risks?

https://spectrum.ieee.org/offshore-wind-military-radar
2•oldnetguy•20m ago•0 comments

PgAdmin 4 9.13 with AI Assistant Panel

https://www.pgadmin.org/docs/pgadmin4/9.13/query_tool.html#ai-assistant-panel
2•__natty__•20m ago•0 comments

There are 56 ethnicities in China–and 55 are getting squashed

https://economist.com/china/2026/03/09/there-are-56-ethnicities-in-china-and-55-are-getting-squashed
7•andsoitis•23m ago•0 comments

The Road

https://en.wikipedia.org/wiki/The_Road
2•chistev•26m ago•1 comments

Fifty years of sexing up tech: Apple's epic hits – and misses

https://www.theguardian.com/technology/2026/mar/10/50-years-apple-epic-hits-and-misses
1•frereubu•27m ago•0 comments

Chinese tech hubs promote OpenClaw AI agent despite security warnings

https://www.reuters.com/world/asia-pacific/chinas-shenzhen-backs-openclaw-ai-with-subsidies-despi...
2•TMWNN•31m ago•0 comments

The Architecture of an Exit Scam: A Technical Audit of Zszrun

2•cappyfjao•33m ago•0 comments

China's AI giants are handing out cash to lure in users

https://economist.com/business/2026/03/09/chinas-ai-giants-are-handing-out-cash-to-lure-in-users
1•andsoitis•33m ago•0 comments

Do the Illegible

https://ashwinsundar.com/posts/legibility-and-programming/
3•wofo•33m ago•0 comments

Amdahl's Law

https://en.wikipedia.org/wiki/Amdahl%27s_law
2•olalonde•35m ago•0 comments