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

Comments

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

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

to:

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

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

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

Oh and maybe cherry-pick

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

Intelligence Ratchet-Theoretical Framework: Self-Stabilizing Superintelligence

https://zenodo.org/records/18482335
1•DarcStar•31s ago•0 comments

Why Bitcoin's is failing its role as a 'safe haven' versus gold

https://www.coindesk.com/markets/2026/01/24/here-s-why-bitcoin-s-is-failing-its-role-as-a-safe-ha...
1•PaulHoule•2m ago•0 comments

Writing a SQL database, take two: Zig and RocksDB

https://notes.eatonphil.com/zigrocks-sql.html
1•ibobev•3m ago•0 comments

Converting data to hexadecimal outputs quickly

https://lemire.me/blog/2026/02/02/converting-data-to-hexadecimal-outputs-quickly/
1•ibobev•4m ago•0 comments

Judgment Isn't Uniquely Human

https://stevenadler.substack.com/p/judgment-isnt-uniquely-human
1•gmays•4m ago•0 comments

Expansion Microscopy Has Transformed How We See the Cellular World

https://www.quantamagazine.org/expansion-microscopy-has-transformed-how-we-see-the-cellular-world...
1•ibobev•6m ago•0 comments

WebCad – free browser-based CAD with AI (export STEP)

https://app.webcad.ca/
1•tonio67•8m ago•1 comments

Show HN: Backseat Writer – AI pair writing

https://backseat-writer.vercel.app/demo
4•Dansvidania•9m ago•1 comments

Show HN: Implementation of Google's PaperBanana (diagram generation from text)

https://github.com/llmsresearch/paperbanana
1•dippatel1994•11m ago•0 comments

Clean Coder: The Dark Path (2017)

https://blog.cleancoder.com/uncle-bob/2017/01/11/TheDarkPath.html
1•andrewjf•11m ago•1 comments

What Do You Think of My Business Idea? (Claude Ad) [video]

https://www.youtube.com/watch?v=De-_wQpKw0s
3•eamag•15m ago•0 comments

Show HN: Grok Imagine – High-fidelity FLUX.1 generation with cinematic video

https://grok-imagine.me/
1•thenextechtrade•15m ago•0 comments

Show HN: Seren – Serverless Postgres, Rust SDK, CLI, & MCP Server for AI Agents

https://github.com/serenorg/seren
2•taariqlewis•15m ago•0 comments

Recursive Knowledge Synthesis for Multi-LLM Systems

https://arxiv.org/abs/2601.08839
1•bob1029•18m ago•0 comments

Microsoft's Pivotal AI Product Is Running into Big Problems

https://www.wsj.com/tech/ai/microsofts-pivotal-ai-product-is-running-into-big-problems-ce235b28
6•fortran77•19m ago•1 comments

Even after cutting EV incentives, Norway only sold 98 diesel cars in January

https://electrek.co/2026/02/03/even-after-cutting-ev-incentives-norway-only-sold-98-diesel-cars-i...
3•ceejayoz•20m ago•0 comments

Show HN: CuaBot – Co-op computer-use for any coding agent

https://github.com/trycua/cua
1•frabonacci•21m ago•0 comments

Forensic Photonics verifies digital evidence with Content Credentials

https://contentauthenticity.org/blog/how-forensic-photonics-verifies-digital-evidence-with-conten...
1•hasheddan•22m ago•0 comments

Show HN: DuoBolt – a review-first duplicate file finder powered by BLAKE3

https://duobolt.app/
2•r9ne•23m ago•1 comments

LibreQoS: Online Bufferbloat Test

https://bufferbloat.libreqos.com/
1•goodburb•23m ago•0 comments

Why the Future of Movies Lives on Letterboxd

https://www.nytimes.com/interactive/2026/02/03/magazine/letterboxd-film-discussion-site-streaming...
1•mitchbob•23m ago•1 comments

How do you validate AI-generated data transformations before prod?

https://www.yorph.ai
1•areddyfd•23m ago•1 comments

If AI Writes the Code, What Should Engineers Learn?

https://the-learning-agency.com/the-cutting-ed/article/if-ai-writes-the-code-what-should-engineer...
2•selvaprakash•24m ago•0 comments

A programmable, Lego-like material for robots emulates life's flexibility

https://techxplore.com/news/2026-02-programmable-lego-material-robots-emulates.html
1•Brajeshwar•24m ago•0 comments

Anthropic Super Bowl Spot Skewers ChatGPT Ads

https://www.businessinsider.com/anthropic-super-bowl-openai-chatgpt-ads-claude-2026-2
2•tortilla•24m ago•0 comments

Physicists achieve near-zero friction on macroscopic scales

https://phys.org/news/2026-02-physicists-friction-macroscopic-scales.html
1•Brajeshwar•25m ago•0 comments

Pipe organ playing a single, nonstop song until 2640

https://www.popsci.com/technology/pipe-organ-one-song-2640/
1•Brajeshwar•25m ago•0 comments

SpaceX grounds Falcon 9 missions, could impact ISS launch

https://phys.org/news/2026-02-spacex-grounds-falcon-missions-impact.html
2•bookmtn•25m ago•0 comments

Show HN: Distr 2.0 – A year of learning how to ship to customer environments

https://github.com/distr-sh/distr
1•louis_w_gk•26m ago•0 comments

Show HN: Orpheus, An Agent runtime that scales on queue depth and not CPU

https://github.com/arpitnath/orpheus
3•arpitnath42•27m ago•1 comments