frontpage.
newsnewestaskshowjobs

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".

Show HN: BrowserBox over SSH – The KRNL Browser

https://win9-5.com/krnl
1•keepamovin•1m ago•0 comments

A man who would change Russia

https://www.economist.com/leaders/2026/07/09/the-man-who-would-change-russia
1•andsoitis•2m ago•0 comments

Japan does not cut down centuries-old trees for development; they relocate them

https://timesofindia.indiatimes.com/science/japan-does-not-cut-down-centuries-old-trees-for-devel...
1•speckx•5m ago•0 comments

Show HN: Resultant Engineering Student Tools Website

https://resultant.tools/
1•will2092347•8m ago•0 comments

OpenAI's API can now keep reasoning across turns instead of discarding it

https://drop-05a4352b-803.sophisticated-stay.workers.dev
2•CjHuber•8m ago•0 comments

Camera Chase Vehicle

https://transistor-man.com/gimbal_camera_rover.html
1•geerlingguy•9m ago•0 comments

Microsoft's carbon emissions went up 25 percent in 2025

https://www.theverge.com/tech/963728/microsoft-sustainability-report-2026
1•1vuio0pswjnm7•11m ago•0 comments

Fast Perceptual Image and Video Metrics

https://github.com/halidecx/fmetrics
1•computerbuster•14m ago•1 comments

Show HN: Free AI transcription with faster-whisper on Colab T4 GPU

https://github.com/arthiccc/gcolab-whisper
1•arthiccc•15m ago•0 comments

A plain-English guide to moving a Windows 10 PC to Linux Mint

https://tomadelstein.substack.com/p/chapter-one-linux-system-administration
2•tadelstein•15m ago•0 comments

Xcancel Is Down?

1•DivingForGold•17m ago•4 comments

Show HN: Debloat Slack – Get rid of Slackbot, AI upsells and other annoyances

https://github.com/benri-ai/slack-debloat
2•ed_mercer•19m ago•0 comments

We Helped an Auto Parts Plant Cut MES Query Times by Up to 116x

https://medium.com/@DolphinDB_Inc/how-we-helped-an-auto-parts-plant-cut-mes-query-times-by-up-to-...
1•yiweileng•20m ago•0 comments

Orbitiny Desktop Pilot X Released

https://orbitiny.com/orbitiny-pilot-x-released/
1•speckx•21m ago•0 comments

America's Greatest Hot Dog

https://www.theringer.com/2026/07/02/food/costco-hot-dog-history-explained-cheap
1•gmays•21m ago•0 comments

Show HN: We beat Gemini Embedding 2 by training only 16M params (open weights)

https://huggingface.co/EximiusLabs/fusion-embedding-1-2b-preview
6•abtonmoy•22m ago•0 comments

Prehistoric cave discoveries hint at shared culture between Neanderthals humans

https://www.cnn.com/2026/07/07/science/turkey-cave-neanderthals-humans-shared-culture
1•Bender•22m ago•0 comments

Microsoft data centers will use 8.4M gallons of water per year (2025)

https://www.wpr.org/news/microsoft-data-centers-8-million-gallons-water-each-year
2•1vuio0pswjnm7•22m ago•0 comments

Interesting LLM visualization I stumbled upon

https://www.paradigm.xyz/
2•afunk•23m ago•1 comments

OpenAI's Fidji Simo steps down

https://www.reuters.com/business/openais-applications-chief-fidji-simo-step-down-2026-07-09/
2•abawany•23m ago•0 comments

Flavor Flav and Paris Hilton team up to handle US women's hockey team travel

https://bsky.app/profile/katzish.bsky.social/post/3mq6eyvafbc22
1•mooreds•23m ago•0 comments

Apple's new iPhone comes with Israeli chips

https://nonogra.ph/apples-new-iphone-comes-with-israeli-chips-05-21-2026
6•arkhiver•24m ago•3 comments

Show HN: FOMO – Turn a team's browsing into shared research insight

https://usefomo.co
1•JadAmmar•29m ago•0 comments

3D pelican riding a tricycle (among other rides)

https://percys-garage-3d.openai.chatgpt.site
1•elicash•32m ago•1 comments

Kalshi in talks to expand never-expiring derivatives to new areas

https://www.reuters.com/business/finance/kalshi-talks-with-regulators-expand-never-expiring-deriv...
1•petethomas•32m ago•0 comments

Problem with Muse Spark 1.1

1•mzubairtahir•33m ago•0 comments

Can We Understand How Large Language Models Reason?

https://cacm.acm.org/news/can-we-understand-how-large-language-models-reason/
1•pseudolus•35m ago•0 comments

GPT 5.6 Sol Post-Trained Luna Autonomously

https://twitter.com/larrylv/status/2075279982847541278
1•karmasimida•37m ago•1 comments

John Carmack on the Id Software Layoffs

https://twitter.com/ID_AA_Carmack/status/2075319665564234012
1•ChrisArchitect•37m ago•2 comments

UBEP: Expert Parallelism Communication Library for Production Superpods

https://arxiv.org/abs/2607.06202
1•Jimmc414•38m ago•0 comments