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

Interleaved HTML Streaming (Patching)

https://github.com/WICG/declarative-partial-updates/blob/main/patching-explainer.md
1•jicea•1m ago•0 comments

Walking Duluth

https://walkingtheworld.substack.com/p/walking-duluth
1•paulpauper•1m ago•0 comments

Why I Built Reader: Open-source web scraping for LLMs

https://reader.dev/blog/why-i-built-reader
1•nihalwashere•3m ago•0 comments

OpenClaw and the Great Hiring Hiatus

https://jcalfromallin.substack.com/p/openclaw-and-the-great-hiring-hiatus
1•jhonovich•7m ago•1 comments

The Universal Code

https://randommacro394532.substack.com/p/the-universal-code
1•mramirez97•11m ago•0 comments

New GitHub repository settings to configure pull request access

https://github.com/orgs/community/discussions/187038
1•cpeterso•15m ago•0 comments

GrowthClaw, Distribution Infrastructure for OpenClaw

https://github.com/mrrkrieg/growthclaw
1•dankrieg•16m ago•1 comments

Economic Espionage and Innovation Restrictions (2025) [pdf]

https://andrew-kao.github.io/files/Espionage_draft_20251231.pdf
1•walterbell•17m ago•1 comments

AI is destroying Open Source, and it's not even good yet

https://www.jeffgeerling.com/blog/2026/ai-is-destroying-open-source/
2•VorpalWay•18m ago•3 comments

Biggest Computer Science Breakthroughs in 2025 [video]

https://www.youtube.com/watch?v=DFwppvrL_pE
1•guiambros•20m ago•0 comments

Moonrepo V2 RC

https://moonrepo.dev/blog/moon-v2-rc
1•NamlchakKhandro•20m ago•0 comments

Show HN: Envref – separating secrets from config in .env files

https://xcke.github.io/envref/
1•xcke•22m ago•0 comments

Show HN: Tilth v0.4.1 – 29% cheaper Sonnet, 22% on Opus (benchmark: 114 runs)

1•jahala•22m ago•0 comments

When AI Builds AI

https://cset.georgetown.edu/publication/when-ai-builds-ai/
1•geox•23m ago•0 comments

Nobody Is Talking About Generalized Hill-Climbing (At Runtime)

https://danielmiessler.com/blog/nobody-is-talking-about-generalized-hill-climbing
1•gmays•23m ago•0 comments

Elara – Post-quantum validation protocol with Rust DAM virtual machine and AI

https://github.com/navigatorbuilds/elara-protocol
1•NenadVasic•25m ago•1 comments

Yes, You Can Vibe-Code. Here’s How to Get Started.

https://www.wsj.com/tech/ai/vibe-coding-how-to-guide-211afcf1
3•petethomas•28m ago•0 comments

Lilush – LuaJIT static runtime and shell

https://lilush.link/
1•ksymph•29m ago•0 comments

Show HN: Promo-kit – Receipt-backed promotion engine for tool catalogs

https://www.npmjs.com/package/@mcptoolshop/promo-kit
1•mikeyfrilot•35m ago•2 comments

Kykeon, the sacred elixir of the Eleusinian Mysteries

https://www.nature.com/articles/s41598-026-39568-3
2•Anon84•35m ago•0 comments

Malicious AI swarms can threaten democracy

https://www.science.org/doi/10.1126/science.adz1697
2•imiric•35m ago•2 comments

The El Paso No-Fly Debacle Is Just the Beginning of a Drone Defense Mess

https://www.wired.com/story/the-el-paso-no-fly-debacle-is-just-the-beginning-of-the-drone-defense...
2•c420•36m ago•2 comments

Show HN: Andrej Karpathy's microgpt.py to C99 microgpt.c – 4,600x faster

https://github.com/enjector/microgpt-c
2•Ajay__soni•38m ago•0 comments

A year of RFK jr has changed American science

https://www.scientificamerican.com/article/how-a-year-of-rfk-jr-has-changed-american-science/
4•anigbrowl•42m ago•0 comments

A Survey of In-Context Reinforcement Learning

https://arxiv.org/abs/2502.07978
2•handfuloflight•43m ago•0 comments

Building for an audience of one: starting and finishing side projects with AI

https://codemade.net/blog/building-for-one/
2•lorisdev•44m ago•0 comments

Dpaint.js 0.2.0

https://dpaint.app/
1•doener•44m ago•0 comments

The End of Cargo Culting Startup Accelerators

https://garrickvanburen.com/end-of-accelerators/
1•garrickvanburen•45m ago•0 comments

Remote Work, AI, and the Disappearing Engineer

https://fulghum.io/meaning
1•jordanf•46m ago•0 comments

Mobile Safari web pages are severely limited by memory

https://lapcatsoftware.com/articles/2026/1/7.html
3•akyuu•46m ago•1 comments