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•1y ago

Comments

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

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

to:

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

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

foobarkey•1y ago
Remove merge and add rebase and we agree :)

Oh and maybe cherry-pick

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

I am looking for Mac and Windows testers for my Server Management app

1•nesdzoltd•14s ago•0 comments

Sam Altman Won in Court Against Elon Musk. But, We All Lost

https://www.newyorker.com/news/letter-from-silicon-valley/sam-altman-won-in-court-against-elon-mu...
1•littlexsparkee•20s ago•0 comments

Is Capability a Liability? More Capable Language Models Make Worse Forecasts

https://arxiv.org/abs/2605.22672
1•sbulaev•40s ago•0 comments

Three Ways to See Distance – Camera in Robotics

https://atomsfrontier.substack.com/p/three-ways-to-see-distance
1•jpatel3•1m ago•0 comments

ExtendDB – open-source DynamoDB-compatible API adapter with pluggable storage

https://github.com/ExtendDB/extenddb
1•akajla•2m ago•0 comments

AutoViz: The last project by Leland Wilkinson

https://github.com/h2oai/autoviz
1•johnygomez•2m ago•1 comments

Beyond Deterministic Surfaces: Uncertainty-Aware Geometry Processing

https://blog.siggraph.org/2026/05/beyond-deterministic-surfaces-uncertainty-aware-geometry-proces...
1•rbanffy•2m ago•0 comments

Crypto industry braces for quantum computing threat

https://www.ft.com/content/99c1c1e7-1a1c-479c-9fc8-e21aea5c3f0e
1•JumpCrisscross•2m ago•0 comments

Department of War Publishes Second Release of UFO Files

https://twitter.com/DeptofWar/status/2057799788003737844
1•keepamovin•4m ago•0 comments

Redframes

https://github.com/maxhumber/redframes
1•tosh•4m ago•0 comments

Large language models pass a standard three-party Turing test

https://www.pnas.org/doi/10.1073/pnas.2524472123
2•geox•8m ago•0 comments

AI Edits a Classical Chinese Paper: Multi-Model Stress Test

https://zenodo.org/records/20343571
1•AICHEN•9m ago•0 comments

UK scientists developing new Ebola vaccine that could be ready in months

https://www.bbc.co.uk/news/articles/cy82gkr7xzlo
2•asplake•10m ago•0 comments

China's AI optimism isn't what it seems

https://www.chinatalk.media/p/chinas-ai-optimism-isnt-what-it-seems
2•speckx•11m ago•0 comments

Department of War Publishes Second Release of UAP Files

https://www.war.gov/UFO/?releaseDate=Release+02#records
1•keepamovin•11m ago•0 comments

Quadball Europe Announces European Quadball Cup 2026

https://www.quidditcheurope.org/post/quadball-europe-announces-european-quadball-cup-2026
1•throw_await•11m ago•0 comments

Ask HN: How much AI is in your writing?

2•js98•12m ago•3 comments

Open Source Silicon: the RedHat model works for chip design

https://www.youtube.com/watch?v=MAgHmIu1bK8
2•johncole•12m ago•0 comments

Many-Valued Logic

https://en.wikipedia.org/wiki/Many-valued_logic
1•the-mitr•13m ago•0 comments

Show HN: LLM-mock – Record real LLM API responses once, replay them in tests

https://pypi.org/project/llm-mock
1•roman_t•14m ago•0 comments

Agent-Based Modeling for Simulating U.S. Presidential Elections

https://arxiv.org/abs/2512.05982
1•ian_j_butler•14m ago•0 comments

Vibedock – macOS menu bar app to toggle Claude Code MCP servers

https://vibedock.dev/
1•TheoWtmn•14m ago•0 comments

VSCode Feature Request: Permissions, Sandboxing and Update Management (2018)

https://github.com/microsoft/vscode/issues/52116
1•airstrike•14m ago•0 comments

Hollywood Secures Broad "Omnibus" Pirate Site Blocking Order in UK High Court

https://torrentfreak.com/hollywood-secures-broad-omnibus-pirate-site-blocking-order-in-uk-high-co...
2•austinallegro•16m ago•0 comments

LZ77 decode at 9,903 MB/s: how we broke the sequential bottleneck on CPU

https://twitter.com/yasha1971/status/2057485786514125149
1•tosh•17m ago•0 comments

Linux95apps – Small and fast components that mimic Windows 95 on Linux

https://github.com/HalanoSiblee/linux95apps
1•ashitlerferad•18m ago•0 comments

Interactive Polls for Slidev

https://github.com/asm0dey/slidev-polls/
1•asm0dey•19m ago•0 comments

Goes to Eleven (2020)

https://bits.houmus.org/2020-01-28/this-goes-to-eleven-pt1
1•tosh•19m ago•0 comments

Epos Daimon, the Antifascist Magic School for Teens

https://mssv.net/2026/05/22/epos-daimon-the-antifascist-magic-school-for-teens/
1•adrianhon•20m ago•1 comments

Six search engines worth trying now that Google isn't Google anymore

https://techcrunch.com/2026/05/21/six-search-engines-worth-trying-now-that-google-isnt-really-goo...
1•dreamcompiler•21m ago•0 comments