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

Analyzing How System Prompts Define Agent Behavior

https://www.dbreunig.com/2026/02/10/system-prompts-define-the-agent-as-much-as-the-model.html
1•dbreunig•24s ago•0 comments

Show HN: Kintsugi – A desktop app for reviewing Claude Code sessions

https://events.sonarsource.com/kintsugi/
1•vikvorona•55s ago•0 comments

I made a site for locals to review elected judges

https://www.ohioneedsdads.org/
1•hilliardfarmer•58s ago•0 comments

MyMiniFactory Has Acquired Thingiverse

https://www.myminifactory.com/blog/myminifactory-has-acquired-thingiverse
1•tjwds•1m ago•0 comments

DOE Genesis Mission List of National Science and Technology Challenges

https://www.energy.gov/documents/genesis-mission-science-and-technology-challenges
1•pizza•3m ago•0 comments

Show HN: OpenWhisper – free, local, and private voice-to-text macOS app

https://github.com/richardwu/openwhisper
1•rwu1997•3m ago•0 comments

Philosophical essays and writings designed to touch hearts and inspire souls

http://h5law.com
1•bipopular•4m ago•0 comments

Show HN: Sentinel Core – Open-source AI video search and detection engine

https://github.com/abg-labs/sentinel-core
1•ab-abg•5m ago•0 comments

South Atlantic Magnetic Anomaly Reverses Space Weather-Violence Relationship

https://essopenarchive.org/doi/full/10.22541/essoar.177100590.02890937/v1
1•bikenaga•7m ago•0 comments

CATL's NAXTRA Sodium Ion Battery launch event [video]

https://www.youtube.com/watch?v=ZX0qg1id1Yk
1•thelastgallon•7m ago•0 comments

OpenAI model proposes and proves Physics result

https://arxiv.org/abs/2602.12176
1•KothuRoti•7m ago•0 comments

Window resize pointer does not follow the window's corner shape

https://developer.apple.com/documentation/macos-release-notes/macos-26_3-release-notes
1•htk•8m ago•0 comments

Show HN: PhilosophMe – a minimal iOS app for daily philosophical thinking

https://apps.apple.com/us/app/philosophme/id6758975792
1•walon•8m ago•0 comments

Why does it feel like the whole internet is agreeing with you?

https://ilkco.substack.com/p/why-does-it-feel-like-the-whole-internet
1•SeanLang•8m ago•0 comments

Show HN: AI Rename, Automatic File Renaming in Nautilus

https://github.com/amichae2/AI-Rename
1•amichae2•9m ago•0 comments

ANN: I built a new Ada build tool for personal use

https://github.com/tomekw/tada
1•todsacerdoti•9m ago•0 comments

Show HN: Ground Station – All-in-one satellite monitoring suite (Python, SDR)

https://github.com/sgoudelis/ground-station
3•sgoudelis•9m ago•0 comments

I used a local LLM to analyze my journal entries

https://ankursethi.com/blog/i-used-a-local-llm-to-analyze-my-journal-entries/
1•GeneralMaximus•9m ago•0 comments

Memos: A lightweight, self-hosted memo hub

https://usememos.com
2•client4•12m ago•0 comments

A history of copper mining and refinement

https://worksinprogress.co/issue/the-discovery-of-copper/
3•fanf2•13m ago•0 comments

Woman sentenced for accusing her ex spouse of accessing bank account from space

https://www.kbtx.com/2026/02/12/woman-sentenced-accusing-her-estranged-spouse-illegally-accessing...
2•iancmceachern•13m ago•0 comments

Some Layers of the Linux Desktop

https://jaketrent.com/post/layers-linux-desktop/
3•abnercoimbre•14m ago•1 comments

When Software Drifts, Build Your Own

https://nabraj.com/blog/build-your-own-tools
3•coffeecoders•14m ago•0 comments

The next generation of AI businesses

https://seths.blog/2026/02/the-next-generation-of-ai-businesses/
2•herbertl•15m ago•0 comments

WebMCP is available for early preview

https://developer.chrome.com/blog/webmcp-epp
2•mywacaday•16m ago•0 comments

A Brief History of Xenopus

https://www.asimov.press/p/xenopus
2•surprisetalk•17m ago•0 comments

Rethinking High-School Science Fairs

https://asteriskmag.com/issues/13/rethinking-high-school-science-fairs
2•surprisetalk•17m ago•0 comments

Memory Safety Is

https://matklad.github.io/2025/12/30/memory-safety-is.html
1•surprisetalk•17m ago•0 comments

Show HN: A private, bulk audio converter using WASM (186x real-time speed)

https://vocalremover.dev/bulk-converter/
1•jacoka•18m ago•1 comments

Your company is not a filesystem

https://twitter.com/anvishapai/status/2022062725354967551
1•anvisha•18m ago•0 comments