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•11mo 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•11mo ago
i can't take this seriously if there's no mention of the '--amend' option and 'rebase' command
OutOfHere•11mo ago
It missed "git switch" and "git restore".

Show HN: ShareNova – Browser file sharing, no account, no limits, no storage

https://sharenova.io
1•HatemDabet•2m ago•0 comments

I built OWASP-style security skill packs for LLM apps (NPM install)

https://www.npmjs.com/package/miii-security
1•maruakshay•3m ago•0 comments

How Does the Kubernetes Scheduler Pick a Node?

https://blog.kubesimplify.com/kube-scheduler-deep-dive
1•saiyampathak•4m ago•0 comments

Viral.ad – One URL, 15 Ad Formats (UGC, Reddit, LinkedIn)

https://www.viral.ad/
1•cjdesignstudio•5m ago•0 comments

Australia moves to tax Meta, Google and TikTok to fund newsrooms

https://www.asahi.com/ajw/articles/16534180
1•BaudouinVH•7m ago•0 comments

Windows 11's 5GB monthly .msu updates, AI is only part of the problem

https://www.windowslatest.com/2026/04/29/i-investigated-windows-11s-massive-5gb-monthly-msu-updat...
1•XzetaU8•16m ago•0 comments

IBM Bob: AI Development Partner

https://newsroom.ibm.com/2026-04-28-introducing-ibm-bob-ai-development-partner-that-takes-enterpr...
2•noiv•17m ago•0 comments

Returns to Intelligence

https://papers.ssrn.com/sol3/papers.cfm?abstract_id=6578939
1•_vaporwave_•18m ago•0 comments

US regulator to review Disney licences after Jimmy Kimmel joke about Melania

https://www.bbc.com/news/articles/c4g0zwxl3k0o
2•KnuthIsGod•22m ago•1 comments

OpenGame: Open Agentic Coding for Games

https://arxiv.org/abs/2604.18394
1•lexandstuff•25m ago•0 comments

FBI head James Comey charged with threatening Donald Trump's life

https://www.bbc.com/news/articles/cvgz4rvlem5o
1•KnuthIsGod•26m ago•0 comments

EUV Lithography: History, Latest Results, Technology Roadmap [video]

https://www.youtube.com/watch?v=qGy0GK0PMwc
2•o4c•27m ago•0 comments

Rust Bucket: Agent-first Rust project bootstrapper

https://github.com/imbue-ai/rust-bucket
1•nvader•32m ago•0 comments

Tvheadend: Self-Hosted IPTV Server

https://tvheadend.org
1•hyperific•34m ago•0 comments

$2,500 bug bounty for real-world AI misalignment

https://github.com/Hodlatoor/SyntheticOutlaw/
1•SyntheticOutlaw•37m ago•0 comments

Tech is in turmoil but the rest of corporate America isn't

https://fortune.com/2026/04/28/tech-layoffs-ai-disruption-corporate-america-doesnt-one-silicon-va...
1•1vuio0pswjnm7•40m ago•0 comments

Mistral Workflows: durable AI orchestration built on Temporal

https://mistral.ai/news/workflows
1•justus_bluemer•41m ago•0 comments

RingCore – a minimal async runtime built on io_uring

https://crates.io/crates/ringcore
1•paperplaneflyr•44m ago•0 comments

The unflattering secrets revealed so far in Elon Musk's latest legal feud

https://www.washingtonpost.com/technology/2026/04/23/musk-altman-lawsuit-trial-openai/
2•1vuio0pswjnm7•48m ago•1 comments

Complexity in a Systems Engineering Context(2019) [pdf]

https://www.sei.cmu.edu/documents/4245/2019_017_001_552583.pdf
2•o4c•48m ago•0 comments

The Downgrading of the American Tech Worker

https://nymag.com/intelligencer/article/after-layoffs-meta-is-training-ai-on-its-own-workers.html
10•sizzle•48m ago•0 comments

Perplexity Builds Accuracy into Frontier AI

https://www.perplexity.ai/hub/blog/how-perplexity-builds-accuracy-into-frontier-ai
2•gmays•51m ago•0 comments

PTP/1.0 – Prompt Transport Protocol

https://gpt.gekko.de/ptp-prompt-transport-protocol-rfc/
1•ekadagami•53m ago•0 comments

pnpm v11 Released

https://pnpm.io/blog/releases/11.0
1•sebws•53m ago•0 comments

SanDisk open-sources accelerated SSD pre-conditioning algorithm

https://www.blocksandfiles.com/flash/2026/04/28/sandisk-open-sources-accelerated-ssd-pre-conditio...
1•tanelpoder•53m ago•0 comments

What If Your OS Could Think?

https://github.com/AFKmoney/nexusOS
1•canaddons•54m ago•0 comments

Swift on Nvidia Jetson

https://mihaichiorean.com/blog/hard-part-of-swift-on-jetson/
1•mihaichiorean•1h ago•0 comments

Musk Testifies OpenAI Was Created as Nonprofit to Counter Google

https://www.cnbc.com/2026/04/28/openai-trial-elon-musk-sam-altman-live-updates.html
6•m463•1h ago•0 comments

Voxels in R3forth

https://www.reddit.com/r/Forth/s/wf7M7hV779
1•rickcarlino•1h ago•0 comments

State Dept. Finalizing Plan to Put Trump Picture on U.S. Passports

https://www.thebulwark.com/p/exclusive-state-dept-finalizing-plan
4•mikhael•1h ago•0 comments