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

Show HN: Updated – A dual crossword puzzle where two crosswords share one grid

https://forkle.co.uk/
1•daveoshawrus•39s ago•0 comments

Extracting Signal from the Noise: What We Learned Auto-Triaging Agent PRs

https://huggingface.co/spaces/huggingface/open-source-agent-contributions
1•eginhard•1m ago•0 comments

Show HN: A Wheel of Fortune game you can run in the browser

https://spinorama.io/
1•Wolfmans55•6m ago•0 comments

Show HN: Modeleon – Python DSL that compiles to live Excel formulas

https://github.com/modeleonai/modeleon
2•adilkhanovkz•8m ago•0 comments

Detailed New Features of Firebird 5

https://firebirdsql.org/en/community-news/free-book-detailed-features-of-firebird-5-is-published/
1•mariuz•9m ago•0 comments

I'm 17 and built a Palantir alternative for mid-market supply chains

https://risksim.ai/
1•ottocosta•13m ago•0 comments

One Developer, Two Dozen Agents, Zero Alignment

https://maggieappleton.com/zero-alignment
1•maxua•15m ago•0 comments

Om Malik – What Microsoft's 10-Q Says About OpenAI

https://om.co/2026/05/01/what-microsofts-10-q-says-about-openai/
3•rmason•15m ago•0 comments

What Is Z-Angle Memory and Why Is Intel Developing It?

https://www.hpcwire.com/2026/02/05/what-is-z-angle-memory-and-why-is-intel-developing-it/
1•rbanffy•20m ago•0 comments

Crypto Anarchy and Virtual Communities – Tim C May

https://nakamotoinstitute.org/library/virtual-communities/
1•hamiecod•20m ago•0 comments

Greek mountain snow cover halved in past four decades due to regional warming

https://egusphere.copernicus.org/preprints/2026/egusphere-2026-327/
1•littlexsparkee•21m ago•0 comments

Your Company Is a Skill Now

https://twitter.com/arlobish/status/2046270374174925196
1•arlobish•21m ago•0 comments

The Myth That Made Social Psychology Famous

https://www.speakandregret.michaelinzlicht.com/p/social-psychologys-favourite-murder
1•Anon84•21m ago•0 comments

EPR-2 QaaS Blockchain

https://github.com/Babayagga-bite/epr2-qaas-blockchain
1•babayagga-bite•22m ago•1 comments

I Work 10 Hours a Day for Others. and No, I Don't Regret It

https://comuniq.xyz/post?t=1010
1•01-_-•22m ago•0 comments

Show HN: Perfect Bluetooth MIDI for Windows

9•mayerwin•24m ago•0 comments

Show HN: Ghidora build system, An nx/Bazel alternative

https://ghidora.hyperforge.in
1•StellaMary•25m ago•0 comments

When NASA Told Its Astronauts to Quit Smoking (2014)

https://www.smithsonianmag.com/air-space-magazine/when-nasa-ordered-astronauts-quit-smoking-18095...
2•thunderbong•26m ago•0 comments

What's in a name? Dogs or wolves, painted or wild

https://africageographic.com/stories/whats-name-dogs-wolves-painted-wild/
1•altilunium•27m ago•0 comments

New Lithium-Plasma Engine Passes Key Mars Propulsion Test

https://www.universetoday.com/articles/new-lithium-plasma-engine-passes-key-mars-propulsion-test
1•rbanffy•28m ago•0 comments

Chinese Courts Rule Companies Cannot Fire Workers Simply to Replace Them with AI

https://www.caixinglobal.com/2026-04-30/chinese-courts-rule-companies-cannot-fire-workers-simply-...
3•virgildotcodes•34m ago•1 comments

The Rotary Un-Smartphone

https://skysedge.com/telecom/RUSP/index.html
6•tzury•37m ago•0 comments

Gremlin

https://en.wikipedia.org/wiki/Gremlin
2•jumploops•37m ago•0 comments

The Ethiopian Running Secret

https://aeon.co/essays/what-ethiopian-running-says-about-the-limits-of-human-ability
2•rifish•41m ago•0 comments

Learning my lesson that Python virtual environments aren't always movable

https://utcc.utoronto.ca/~cks/space/blog/python/VenvsNotEntirelyMovable
1•ingve•42m ago•0 comments

Raspberry Pi: A Foundation Model in Your Pocket – Colossus

https://colossus.com/article/raspberry-pi-eben-upton/
1•rbanffy•46m ago•0 comments

Meta Just Killed Open-Source AI

https://www.utkarshapoorva.com/writing/meta-llama-trap/
1•utkarsh_apoorva•49m ago•0 comments

RexIDE now has minimal "integration" with Codex App [video]

https://www.youtube.com/watch?v=K3j8ydsLfWs
1•tomerbd•53m ago•0 comments

Xmemory: Benchmarking Structured AI Memory Against RAG and Hybrid RAG

https://arxiv.org/abs/2604.27906
1•alex_petrov•1h ago•0 comments

Ukraine Overtakes US, 6 EU Countries in Press Freedom Index

https://kyivindependent.com/ukraine-overtakes-united-states-on-press-freedom/
2•dgellow•1h ago•0 comments