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•11mo ago
It missed "git switch" and "git restore".

Carl Jung, Occultist

https://www.ecosophia.net/carl-jung-occultist/
1•phront•1m ago•0 comments

Show HN: Astrial – Spherical Go on a Snub Dodecahedron

https://astrial.app
2•mingli_yuan•1m ago•0 comments

A Glimpse into the Future of Software Development

https://saturnino.substack.com/p/out-of-the-loop
1•lrsaturnino•10m ago•0 comments

Fixing a 20-year-old bug in Enlightenment E16

https://iczelia.net/posts/e16-20-year-old-bug/
3•snoofydude•12m ago•0 comments

When Oil Gets Expensive, Cities Get Better [video]

https://www.youtube.com/watch?v=eXNLaHsKMz8
1•CHB0403085482•12m ago•0 comments

Saying Goodbye to Agile

https://lewiscampbell.tech/blog/260414.html
1•matrixhelix•13m ago•0 comments

Agents as Scaffolding for Recurring Tasks

https://lethain.com/agents-as-scaffolding/
2•gpi•17m ago•0 comments

ZFS: Tutorial for Storage on External Drives

https://jenpeterson.net/zfs-blog/
1•bariumbitmap•19m ago•0 comments

The Economic Value of Eliminating Cancer

https://www.nber.org/papers/w35052
2•paulpauper•28m ago•0 comments

The Economist Is Putting Names (and Faces) to Its Magazine

https://www.nytimes.com/2026/04/13/business/media/economist-magazine-videos.html
1•paulpauper•29m ago•0 comments

The tech jobs bust is real. Don't blame AI (yet)

https://www.economist.com/finance-and-economics/2026/04/13/the-tech-jobs-bust-is-real-dont-blame-...
1•axiomdata316•29m ago•1 comments

Avatar: Aang: The Last Airbender Surfaces Online Months Before Paramount+ Debut

https://www.cartoonbrew.com/feature-film/avatar-aang-last-airbender-leaks-online-259953.html
2•Cider9986•31m ago•0 comments

Show HN: Firefox Sidebar Local LLM

https://github.com/skorotkiewicz/firefox-ai
1•modinfo•33m ago•0 comments

Show HN: Fz.ax – Four thousand weeks of your life, as hexagons

https://fz.ax
1•momentmaker•35m ago•0 comments

Feature Request: Support Agents.md. #6235

https://github.com/anthropics/claude-code/issues/6235
1•gz09•37m ago•0 comments

A tax revolt is under way in America

https://economist.com/united-states/2026/04/14/a-tax-revolt-is-under-way-in-america
1•andsoitis•40m ago•1 comments

Show HN: Why Rotating Vectors Makes Compression Beautiful

https://demos.connectai.blog/quantization_blog.html
1•linux_devil•40m ago•0 comments

Photocatalytic Water Splitting

https://en.wikipedia.org/wiki/Photocatalytic_water_splitting
2•wolfi1•41m ago•0 comments

Deriving the Y Combinator (2008)

https://blog.jcoglan.com/2008/01/10/deriving-the-y-combinator/
1•aragonite•53m ago•0 comments

Will Elon Musk ever be forced to explain what he did inside DOGE?

https://www.cnn.com/2026/04/13/politics/elon-musk-doge-lawsuits-avoid-deposition-questions
9•1659447091•54m ago•3 comments

The disappearance of old Tokyo businesses

https://www.tokyotimes.org/the-disappearance-of-old-tokyo-businesses/
1•razorbeamz•55m ago•0 comments

Show HN: Honeytree – Grow a forest in your terminal while you code

https://github.com/Varun2009178/honeytree
1•varunn29•56m ago•0 comments

Krafton CEO used ChatGPT in failed bid to avoid paying US$250M bonus

https://www.theguardian.com/technology/2026/mar/18/subnautica-2-publisher-krafton-ceo-reinstated-...
3•doppp•59m ago•1 comments

Moanpoint: Maps TrackPoint pressure to audio output

https://github.com/nicolasgutierrezdev/moanpoint
1•neptunianalien•1h ago•0 comments

Decline in U.S. overdose deaths threatened by changing street drug supply

https://text.npr.org/nx-s1-5783750
1•1659447091•1h ago•0 comments

New AI capabilities are coming to Google Vids, powered by Lyria 3 and Veo 3.1

https://blog.google/products-and-platforms/products/workspace/google-vids-updates-lyria-veo/
3•spaghettifythis•1h ago•1 comments

The Stern-Gerlach Experiment (1967)[video]

https://www.youtube.com/watch?v=AcTqcyv-V1I
1•nill0•1h ago•0 comments

Show HN: BSCS Bench – College CS Curriculum AI Benchmark

https://www.bscsbench.com/
1•charlielockyer•1h ago•0 comments

Bessent: Order requiring banks to collect citizenship information in process

https://thehill.com/homenews/administration/5830266-trump-executive-order-banking-system-citizens...
1•KnuthIsGod•1h ago•0 comments

The Complete Briggs and Stratton Buckboard Flyer Build [video]

https://www.youtube.com/watch?v=xzYwGcX3CwA
1•pillars•1h ago•0 comments