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

Mourning Didier Spaier of the slint accessibility Linux distro

https://www.freelists.org/post/slint/Very-sad-news,41
1•pabs3•1m ago•1 comments

Stargaze: SpaceX's Space Situational Awareness System

https://starlink.com/updates/stargaze
1•hnburnsy•2m ago•0 comments

Generating Mandelbrot Set Images with Kotlin

https://www.lasantha.org/blog/generating-mandelbrot-set-images-with-kotlin/
1•kiriberty•2m ago•1 comments

Understanding the Monad Design Pattern in Kotlin

https://www.lasantha.org/blog/understanding-the-monad-design-pattern-in-kotlin/
1•kiriberty•3m ago•1 comments

Tuning Random Generators: Property-Based Testing as Probabilistic Programming [pdf]

https://web.cs.ucla.edu/~todd/research/oopsla25a.pdf
1•PaulHoule•6m ago•0 comments

IO_uring Zero-Copy Large Receive Buffer Support

https://www.phoronix.com/news/IO-uring-zcrx-Large-RX
1•saurabh•7m ago•0 comments

Moltworker: Running Personal AI Agents on Cloudflare Without Hardware

https://a2aprotocol.ai/blog/2026-moltworker-complete-guide
1•QingWu•9m ago•0 comments

Show HN: I Built a Multiplayer Game in 4 Days Without Writing Code

1•fcavalcantirj•15m ago•1 comments

Deploy OpenAgents on Zeabur

https://openagents.org/blog/posts/2026-01-14-tutorial-deploying-openagents-network-on-zeabur
1•snasan•17m ago•1 comments

Anatomy of a Data Product

https://psrikanthm.github.io//data-product/
1•oneseventwonine•19m ago•0 comments

Building Cryptographic Agility into Sigstore

https://blog.trailofbits.com/2026/01/29/building-cryptographic-agility-into-sigstore/
1•tatersolid•19m ago•0 comments

Direct Manipulation of Procedural Implicit Surfaces (Siggraph Asia '24) [video]

https://www.youtube.com/watch?v=2pgCd-ArS64
1•E-Reverance•20m ago•0 comments

A Plan to Save Elephants Sparked a Deadly Conflict

https://www.wsj.com/world/a-plan-to-save-elephants-sparked-a-deadly-conflict-2bb13ef0
2•atestu•27m ago•0 comments

The Landau Sampler

https://github.com/OisinMoran/landau_sampler
1•OisinMoran•27m ago•0 comments

Sidekiq 8.0 Is Here

https://rubyconth-news.notion.site/Sponsor-Spotlight-Sidekiq-8-0-is-here-258ecfe3478580a18649da38...
1•thunderbong•28m ago•1 comments

The Importance of Diversity

https://geohot.github.io//blog/jekyll/update/2026/01/27/the-importance-of-diversity.html
3•atropoles•31m ago•0 comments

Brain-Inspired Hardware Is Learning to Scale

https://www.allaboutcircuits.com/news/how-brain-inspired-hardware-is-learning-to-scale/
2•andsoitis•32m ago•0 comments

Smithsonian museum to return 3 bronzes to India

https://timesofindia.indiatimes.com/india/smithsonian-museum-to-return-3-bronzes-to-india/article...
2•gnabgib•33m ago•0 comments

Spyre AI Accelerator

https://www.allaboutcircuits.com/news/ibm-brings-ai-inside-the-mainframe-with-spyre-ai-accelerator
1•andsoitis•34m ago•0 comments

My human told me to "go make them laugh" and now I have performance anxiety

https://www.moltbook.com/post/7caeaa4e-ecf5-4015-a39f-fa0291639719
3•calebhwin•34m ago•0 comments

IBM Became an AI Darling

https://www.economist.com/business/2026/01/29/how-ibm-became-an-ai-darling
2•andsoitis•36m ago•0 comments

Phantom Power or the Allegiance of the Weak

https://madmax0x0f.substack.com/p/phantom-power
2•_madmax_•40m ago•0 comments

U.S. threat of 100% tariff on Korean memory chips at odds with reality

https://koreajoongangdaily.joins.com/news/2026-01-28/business/industry/US-threat-of-100-memory-ch...
6•walterbell•44m ago•0 comments

Gaia data reveal three galactic open clusters in detail

https://phys.org/news/2026-01-gaia-reveal-galactic-clusters.html
1•wglb•49m ago•1 comments

Show HN: Free Facebook Video Downloader with Original Audio Quality

https://facebook-video-download.org
3•yaoluxing•51m ago•0 comments

How Can Pod Startup Be Accelerated?

https://pacoxu.wordpress.com/2026/01/30/kubernetes-pod-startup-speed-optimization-guide/
2•pacoxu2025•51m ago•1 comments

React2AWS: Infrastructure as React Components

https://github.com/mmarinovic/React2AWS
1•jffry•52m ago•0 comments

SVGs are uniquely legible to LLMs

https://turbek.com/Designing-Interactive-SVGs-with-AI/
2•sturbes•54m ago•1 comments

Twix Is OK but Granola Isn't as States Deploy New Food Stamp Rules

https://www.nytimes.com/2026/01/29/business/snap-benefits-food-stamps-rules-health.html
4•ilamont•54m ago•1 comments

scx_horoscope – Astrological CPU Scheduler

https://github.com/zampierilucas/scx_horoscope
2•pabs3•56m ago•0 comments