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

hk: Git Hook Manager

https://hk.jdx.dev/
1•bpierre•1m ago•0 comments

Better WiFi for trains under government plans

https://www.bbc.co.uk/news/articles/c2d22929ww0o
1•edward•2m ago•0 comments

The App for Trump Accounts Will Launch Thursday

https://www.wsj.com/finance/investing/the-app-for-trump-accounts-will-launch-thursday-heres-what-...
1•JumpCrisscross•4m ago•0 comments

I built a FICO-style stock score and options screener for retail investors

https://www.financedashboard.ai/
1•avetikbabayan•5m ago•0 comments

AI Threatens the Giants of Consulting

https://www.ft.com/content/d82d2a5c-74ab-4eb9-a658-fd5467e71670
1•JumpCrisscross•7m ago•0 comments

iPhones Running iOS 26 Are Freezing FaceTime Calls When They Detect Nudity

https://www.pcmag.com/news/iphones-running-ios-26-freeze-facetime-calls-when-theres-nudity
4•vinni2•11m ago•0 comments

Facebook launches a 'Plus' subscription that gives you extra features

https://www.theverge.com/tech/938500/facebook-whatsapp-instagram-meta-ai-subscriptions
3•taubek•12m ago•0 comments

Show HN: VAEN – Package and import portable AI coding-agent Harnesses

https://github.com/sjhalani7/vaen
4•sjhalani7•12m ago•2 comments

Show HN: Sneakily steer candidates toward naive brute-force solutions

https://www.gonfire.io/
1•abr0ahm•16m ago•0 comments

Open-source agricultural OS,offline-first,AGPL, grow tent to 500-warehouse scale

https://github.com/dgang0404/gr33n
1•dgang0404•17m ago•0 comments

Imagor 1.9.1 Benchmark Summary

https://docs.imagor.net/benchmarks/
1•cshum•17m ago•0 comments

Web3 Creator-Driven LottoFi Platform on Solana

https://salat.to/
1•Shytov•18m ago•0 comments

Agent Governance Toolkit

https://github.com/microsoft/agent-governance-toolkit
1•yakkomajuri•19m ago•0 comments

Roku OS's home screen now features a large, permanent ad

https://arstechnica.com/gadgets/2026/05/roku-oss-home-screen-now-features-a-large-permanent-ad/
3•canucker2016•22m ago•0 comments

How to Quickly Warm Up Your MacBook

https://z3ugma.github.io/2019/11/18/warm-up-your-macbook/
7•kristianp•23m ago•2 comments

Researcher "gave Claude Code 'ADHD' and it thinks 2x better now."

https://thenewstack.io/claude-code-adhd/
1•udit_50•26m ago•0 comments

Your AI agent can now trade for you on Robinhood

https://www.cnbc.com/2026/05/27/your-ai-agent-can-now-trade-for-you-on-robinhood-and-buy-stuff-wi...
1•frays•26m ago•0 comments

WP Engine and Automattic Trade Accusations

https://www.therepository.email/wp-engine-and-automattic-trade-accusations-of-withheld-evidence-i...
2•okneil•26m ago•0 comments

Show HN: Open-source tool for learning anything using AI

https://www.zoonk.com/
2•ceolin•27m ago•0 comments

Show HN: Open-Source AI Racing Harness

https://www.elodin.systems/post/elodin-ai-grand-prix-race-sim-harness
2•danAtElodin•27m ago•0 comments

Ask HN: Advice on transitioning from employed dev to independent consultant

1•aspiring_•29m ago•0 comments

From AI Interest to a Working System: How SMBs Can Start with AI

https://blog.nemausat.com/from-ai-interest-to-a-working-system
1•Ruidy•32m ago•0 comments

Hardline calculus – happy Eid Mubarak

https://hardline.tiiny.site/
1•shaunxcode•33m ago•0 comments

Someone Created an ESP32 Apps Store

https://www.xda-developers.com/someone-created-an-esp32-app-store-and-it-lets-you-flash-apps-stra...
2•Voblit•33m ago•0 comments

Perfect randomness realized for the first time

https://phys.org/news/2026-05-randomness.html
2•lschueller•34m ago•0 comments

Switchbot Humidity/Temp-Sensor OpenSource Receiver

https://github.com/datenbazi/switchbot-w3400010
2•alpenbazi•35m ago•1 comments

Codeboarding – Interactive architecture diagrams for codebases

https://github.com/CodeBoarding/CodeBoarding
3•scapecast•36m ago•0 comments

On Why I Write

https://www.hackyexperiments.com/blog/why-i-write
2•bilater•38m ago•1 comments

Why "children," not "childs"? (2016)

https://grammarphobia.com/blog/2016/03/en-plural.html
3•downbad_•40m ago•0 comments

Meta launches Instagram, Facebook, and WhatsApp subscriptions

https://www.instagram.com/reel/DY2dHCWMZST/
8•shen•41m ago•2 comments