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

DataCenter.FM – background noise app featuring the sound of the AI bubble

https://datacenter.fm/
2•louisbarclay•4m ago•0 comments

LLM 0.32a0 is a major backwards-compatible refactor

https://simonwillison.net/2026/Apr/29/llm/
2•thebeardisred•5m ago•0 comments

Coding Was Never the Hard Part: What I Wish Every Business Leader Knew About AI

https://koushikdasika.com/blog/coding-was-never-the-hard-part/
2•HalcyonicStorm•6m ago•0 comments

Mozilla's Opposition to Chrome's Prompt API

https://github.com/mozilla/standards-positions/issues/1213
3•jaffathecake•12m ago•0 comments

Show HN: Pg_column_Tetris – a pg extension for optimal column alignment

https://github.com/rogerwelin/pg_column_tetris
2•rogerw•12m ago•0 comments

Reasoning compresses. Factual knowledge doesn't

https://twitter.com/bojie_li/status/2049314403208896521
2•stared•14m ago•0 comments

Nvidia releases Nemotron 3 Nano Omni multimodal model

https://blogs.nvidia.com/blog/nemotron-3-nano-omni-multimodal-ai-agents/
2•madaxe_again•18m ago•0 comments

Bouncing Droplet "Quantum Mechanics"

https://scottlocklin.wordpress.com/2026/04/28/bouncing-droplet-quantum-mechanics/
2•tosh•18m ago•0 comments

Terminal file picker and inline editor for fast CLI workflows

https://pypi.org/project/terminal-file-picker/
2•sahedwave•18m ago•0 comments

A photon was teleported across 270 meters in quantum breakthrough

https://www.sciencedaily.com/releases/2026/04/260429102030.htm
2•geox•18m ago•0 comments

Patrick Collison Reflects on Stripe Sessions

https://twitter.com/patrickc/status/2049705418436600244
2•tosh•19m ago•0 comments

OpenAI Codex prompt includes explicit directive: "never talk about goblins"

https://arstechnica.com/ai/2026/04/openai-codex-system-prompt-includes-explicit-directive-to-neve...
3•pookieinc•21m ago•0 comments

Hunting Down the Google-Sent Phishing Wave Compromising 30k Facebook Accounts

https://guard.io/labs/accountdumpling---hunting-down-the-google-sent-phishing-wave-compromising-3...
2•vulnerabiliT•22m ago•0 comments

Soundness Failures in LaBRADOR Implementations from NTT-Friendly Rings

https://blog.zksecurity.xyz/posts/labrador-bugs/
7•zgeorgios•23m ago•0 comments

Chinese GPU maker Lisuan Tech is the fourth GPU maker with WHQL certification

https://www.tomshardware.com/pc-components/gpus/in-historic-first-chinese-gpu-maker-lisuan-tech-b...
3•cassianoleal•25m ago•0 comments

Thoughts on WebAssembly as a Stack Machine

https://eli.thegreenplace.net/2026/thoughts-on-webassembly-as-a-stack-machine/
2•ingve•25m ago•0 comments

Emulating PS2 Floating-Point Numbers: IEEE 754 Differences (2023)

https://www.gregorygaines.com/blog/emulating-ps2-floating-point-nums-ieee-754-diffs-part-1/
2•haunter•29m ago•0 comments

Beyond 80/20: High-Entropy Minority Tokens Drive Effective RL for LLM Reasoning

https://arxiv.org/abs/2506.01939
2•mdp2021•32m ago•0 comments

It is just too much of everything

https://www.respan.ai/market-map
2•sminchev•34m ago•1 comments

A Brief, Incomplete, and Mostly Wrong History of Programming Languages (2009)

http://james-iry.blogspot.com/2009/05/brief-incomplete-and-mostly-wrong.html
3•downbad_•40m ago•1 comments

The Elephant in the Room

https://www.joshwcomeau.com/email/wham-launch-005-elephant-2-p/
2•ameybhavsar•41m ago•0 comments

OpenAI Technical Goals (2016)

https://openai.com/index/openai-technical-goals/
2•chistev•43m ago•1 comments

US orders chip equipment companies to halt some shipments to China #2 chipmaker

https://www.reuters.com/world/china/us-orders-chip-equipment-companies-halt-some-shipments-hua-ho...
2•giuliomagnifico•45m ago•0 comments

The box-tickers shall inherit the Earth

https://spectator.com/article/the-box-tickers-shall-inherit-the-earth/
2•calpaterson•47m ago•0 comments

VS Code now enables Git AI co-authoring by default

https://code.visualstudio.com/updates/v1_118#_copilot-added-as-a-git-coauthor-by-default
2•nh43215rgb•47m ago•0 comments

Inspired

https://daniel.haxx.se/blog/2026/04/30/inspired/
2•TangerineDream•47m ago•0 comments

Near Future of Programming Languages (2017) [pdf]

https://web.archive.org/web/20220325175116/http://dev.stephendiehl.com/nearfuture.pdf
2•tosh•50m ago•0 comments

Why are the Artemis II photos on Flickr?

https://www.anildash.com/2026/04/30/artemis-photos-flickr/
3•Tomte•52m ago•0 comments

AI Slopocalypse 2027

https://www.stephendiehl.com/posts/ai_slop_2027/
2•andsoitis•52m ago•0 comments

Ask HN: Anyone using AI agents for active learning sprints? Here's my setup

3•bhagyeshsp•52m ago•0 comments