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

Linux Patched for Safe RET Interrupt Vulnerability

https://www.phoronix.com/news/Linux-Safe-RET-Interrupt-Vuln
1•Bender•17s ago•0 comments

Autonomous Buying of Experiment Equipment

https://chillphysicsenjoyer.substack.com/p/autonomous-buying-of-experiment-equipment
1•crescit_eundo•2m ago•1 comments

Show HN: Agent Feedback – Local first web UI feedback widget that agents pick up

https://github.com/montanaflynn/agent-feedback
1•anonfunction•3m ago•0 comments

Show HN: Audit Any Page. Find SEO Gaps. Improve Rankings

https://checkpageseo.com/
1•not_wowinter14•4m ago•0 comments

If AI Is Taking Jobs, Your HR People May Be First to Go

https://news.bloomberglaw.com/daily-labor-report/if-ai-is-really-taking-jobs-your-hr-people-may-b...
1•johnbarron•4m ago•0 comments

Cpdlc over ATN-B1 Vulnerabilities

https://www.cisa.gov/news-events/ics-advisories/icsa-26-219-01
1•anonymousiam•4m ago•1 comments

Ask HN: If you had to relearn Emacs today, how would you?

1•Varelion•11m ago•0 comments

A 0-Click Exploit Chain for the Pixel 10

https://blackhat.com/us-26/briefings/schedule/#a-0-click-exploit-chain-for-the-pixel-10-53404
2•bordercontrol•11m ago•1 comments

Lynn Hill – First free ascent of the sheer rock face of The Nose on El Capitan

https://en.wikipedia.org/wiki/Lynn_Hill
2•gurjeet•15m ago•0 comments

Show HN: SwiftUI/React/Compose keyframe editor

https://inertiagraphics.com
1•hpen•17m ago•0 comments

Tyler Cowen: You'll Learn to Love AI Writing

https://www.thefp.com/p/tyler-cowen-youll-learn-to-love-ai-writing
1•gwintrob•17m ago•0 comments

Modernizing 10-Year-Old PHP Applications Without Breaking the Monolith

https://www.gridphp.com/blog/modernizing-10-year-old-php-applications-without-breaking-the-monolith/
1•gridphp•17m ago•0 comments

From unchecked AI spend to complete control: How Rippling built AI Spend Console

https://www.rippling.com/blog/introducing-ai-spend-console
1•jaredwiener•18m ago•0 comments

Show HN: Samudra Manthana, an asymmetric strategy board game in the browser

https://mighty840.itch.io/samudra-manthan
1•sharang33•23m ago•0 comments

In-terminal browser: do Kitty animation deltas beat full-frame updates?

https://www.reddit.com/r/browsers/comments/1vidk09/interminal_browser_do_kitty_animation_deltas_b...
1•syumei•24m ago•0 comments

Metabase – Please Upgrade Now

https://www.metabase.com/blog/security-update
2•karakanb•25m ago•0 comments

A shell exclamation mark is not for yelling. Be lazy

https://refp.se/articles/your-shell-and-the-lazy-exclamation-mark
2•birdculture•28m ago•0 comments

Will Your First Home Robot Have Legs or Wheels?

https://itcanthink.substack.com/p/will-your-first-home-robot-have-legs
1•hasheddan•29m ago•0 comments

I'm excited for Intel after testing the XPS 13

https://www.jeffgeerling.com/blog/2026/excited-for-intel-efficiency/
2•isagues•29m ago•0 comments

Show HN: Arena for Speech-to-Speech Models

https://voiceduel.com/
2•armaanp23•33m ago•0 comments

Email Personalization That Gets Read

https://www.maxprog.com/site/blog/post.php?id=2984&topic=Email-Personalization-That-Gets-Read
1•maxprog•33m ago•0 comments

Astronomers Find a New Object from the Early Universe Using Webb Data

https://www.universetoday.com/articles/astronomers-find-a-new-object-from-the-early-universe-usin...
2•rbanffy•34m ago•0 comments

Show HN: Podiom – Persistent project context, goals and scheduling for AI agents

https://github.com/Podiom/Podiom
1•Maphielbso•36m ago•0 comments

Collapse OS - Bootstrap post-collapse technology

https://collapseos.org/
1•sedatk•36m ago•0 comments

Opus5/low can do CryptoNote base58 decoding toolless, in working memory alone

https://bsky.app/profile/jleclanche.bsky.social/post/3msji47npvk2y
10•scrollaway•38m ago•3 comments

Chip design from the bottom up – Reiner Pope [video]

https://www.youtube.com/watch?v=oIk3R-sMX5o
2•__rito__•40m ago•0 comments

Water system controllers don't belong on the internet, says ex-NSA chief

https://www.theregister.com/security/2026/08/07/water-system-controllers-dont-belong-on-the-inter...
21•Bender•41m ago•4 comments

Cop who used police system to snoop for info on crook pals sentenced

https://www.theregister.com/legal/2026/08/07/cop-who-used-police-system-to-snoop-for-info-on-croo...
2•Bender•42m ago•0 comments

Flesh-eating screwworms feast on humans in Mexico; human cases top

https://arstechnica.com/health/2026/08/flesh-eating-screwworms-feast-on-humans-in-mexico-human-ca...
1•Bender•43m ago•0 comments

Show HN: From raw Point Cloud dataset to regular Grid index

https://huggingface.co/spaces/adec314/point-to-grid
1•adec314•47m ago•0 comments