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•8mo ago

Comments

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

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

to:

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

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

foobarkey•8mo ago
Remove merge and add rebase and we agree :)

Oh and maybe cherry-pick

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

Show HN: LeetDreamer: AI-hallucinated LeetCode solution videos

https://github.com/joshribakoff/leetdreamer
1•joshribakoff•1m ago•0 comments

Designing 'One Hundred and One Dalmatians'

https://animationobsessive.substack.com/p/designing-one-hundred-and-one-dalmatians
1•ani_obsessive•3m ago•0 comments

Cronos Browser – Local AI, decentralized pool mode, and zero telemetry

https://cronos.avalw.com/
1•CronosBrowser•4m ago•1 comments

Cursedcraft, a software rendered voxel sandbox for the TTY

https://codeberg.org/mueller_minki/cursedcraft/
1•minki_the_avali•6m ago•1 comments

Gene therapy advances as scientists guide jumping DNA to target faulty genes

https://medicalxpress.com/news/2025-12-gene-therapy-advances-scientists-dna.html
3•PaulHoule•11m ago•0 comments

Veronika, the Tool-Using Cow

https://arstechnica.com/science/2026/01/meet-veronika-the-tool-using-cow/
2•nxobject•15m ago•1 comments

Nova Launcher Added Facebook and Google Ads Tracking

https://lemdro.id/post/lemdro.id/35049920
1•celsoazevedo•16m ago•1 comments

Show RLM Analyzer–AI code analysis using recursive LLMs(MIT CSAIL research)

https://npmjs.com/package/rlm-analyzer
1•zendizmo•16m ago•1 comments

Porsche Sold More Electrified Cars in Europe in 2025 Than Pure Gas-Powered Cars

https://newsroom.porsche.com/en/2026/company/porsche-deliveries-2025-41516.html
9•m463•18m ago•0 comments

Show HN: Prompt Reboot – a tool to surface failure modes in your prompt

https://www.promptreboot.com/
1•cedarscarlett•20m ago•0 comments

LinkedIn Causing 7000 Requests/Second? CPU Spike Across Fresh Systems

https://www.youtube.com/watch?v=24wNHf9JyMY
1•praveenscience•22m ago•0 comments

Harvard legal scholars debate the state of the U.S. constitution

https://www.harvardmagazine.com/social-sciences/is-the-constitution-broken
6•KnuthIsGod•24m ago•2 comments

How Much Is Eight Dollars?

https://defector.com/how-much-is-eight-dollars
2•MaysonL•27m ago•0 comments

The creator of Node.js says the era of writing code is over

https://jpcaparas.medium.com/the-creator-of-node-js-says-the-era-of-writing-code-is-over-8320c868...
3•CharlesW•31m ago•2 comments

Uber, often sued over car crashes, pushes for law to limit lawyer fees

https://www.latimes.com/california/story/2026-01-17/uber-personal-injury-lawsuits-california-law
6•sizzle•38m ago•1 comments

F5 tackles AI security with new platform extensions

https://www.networkworld.com/article/4118696/f5-tackles-ai-security-with-new-platform-extensions....
1•ohjeez•38m ago•0 comments

Uber Pushes to Cap Personal Injury Lawyer Payouts A.G. 25-0022 [pdf]

https://oag.ca.gov/system/files/initiatives/pdfs/25-0022A1%20%28Self%20Dealing%20Attorneys%29.pdf
5•sizzle•40m ago•0 comments

Austrian cow shows first case of flexible, multi-purpose tool use in cattle

https://www.amazon.com/IASEAHK-Cushions-Dining-Chairs-Kitchen/dp/B0DJCT6H9D/ref=sr_1_9?dib=eyJ2Ij...
2•bookmtn•42m ago•0 comments

SearchGuard: How Google detects bots and what the SerpAPI lawsuit reveals

https://searchengineland.com/inside-google-searchguard-467676
5•sans_souse•43m ago•0 comments

Show HN: AlgoSync – A social space for builders to share the "real" tech journey

https://www.algosyncverse.com/
1•lyquochao84•44m ago•1 comments

Netflix Ruined Korean Dramas Forever [video]

https://www.youtube.com/watch?v=p1_j6izmEX4
2•danhite•45m ago•1 comments

Opensync

https://github.com/waynesutton/opensync
1•handfuloflight•45m ago•0 comments

Bank of England 'must plan for a financial crisis triggered by aliens'

https://www.msn.com/en-gb/news/uknews/bank-of-england-must-plan-for-a-financial-crisis-triggered-...
7•matthewsinclair•55m ago•6 comments

EnergyNet Explained: Internetification of Energy Distribution

https://arxiv.org/abs/2509.08152
1•zekrioca•56m ago•0 comments

Scaling long-running autonomous coding

https://simonwillison.net/2026/Jan/19/scaling-long-running-autonomous-coding/
2•srameshc•57m ago•0 comments

Ask HN: Do Hackathons Still Matter in 2026?

4•rafaepta•59m ago•1 comments

React Native Windows v0.81

https://devblogs.microsoft.com/react-native/%f0%9f%9a%80react-native-windows-v0-81-is-here/
1•soheilpro•59m ago•0 comments

AI Is a Horse (2024)

https://kconner.com/2024/08/02/ai-is-a-horse.html
1•zdw•59m ago•0 comments

SolarPunk: Autonomous redistribution system with anti-corporate code

https://github.com/MeekoThaRaccoon/SolarPunk
2•RealSolarPunk•59m ago•1 comments

Ygrep: Fast, local, indexed code search tool optimized for AI coding assistants

https://github.com/yetidevworks/ygrep
1•kristianp•1h ago•0 comments