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

Castel.dev Is Dead

1•mufeedcm•2m ago•0 comments

Ciliate Is About to Die (2020) [video]

https://www.youtube.com/watch?v=ibpdNqrtar0
1•polygot•5m ago•0 comments

The Dot and the Swarm

https://www.oneusefulthing.org/p/the-dot-and-the-swarm
1•saikatsg•5m ago•0 comments

The cost of lies: A Mineserver story

https://www.jeremyreimer.com/rockets-item.lsp?f=true&p=272
1•luu•11m ago•0 comments

Dyson CameraJet

https://geohot.github.io//blog/jekyll/update/2026/10/03/dyson-camerajet.html
1•smilelamp•12m ago•0 comments

wizard-engine: Research WebAssembly Engine

https://github.com/titzer/wizard-engine/
1•luu•17m ago•0 comments

Amazon responds to data center backlash, says it no longer uses NDAs

https://techcrunch.com/2026/10/03/amazon-responds-to-data-center-backlash-says-it-no-longer-uses-...
1•noisysoc•19m ago•0 comments

Archiving the Oldest Webcam Feed

https://hackaday.com/2026/10/01/archiving-the-worlds-oldest-webcam-feed/
2•rdmuser•21m ago•0 comments

Forbidden Stories and UC Berkeley Journalism launch cross-border lab

https://journalism.berkeley.edu/announce-forbidden-stories-lab-uc-berkeley-journalism/
1•rdmuser•24m ago•1 comments

Weirdstuff Warehouse Reopens

https://weirdstuff.com/
2•bananaboy•25m ago•0 comments

Flying cell tower beams phone signal to Japan from 10 miles up

https://newatlas.com/aircraft/sceye-flying-cell-tower-beams-phone-signal-stratosphere/
1•geox•27m ago•0 comments

Pico CSS is no longer maintained (final release v2.1.1)

1•anydigital•32m ago•0 comments

Being asked to sanitise Wikipedia entries

https://www.rubenerd.au/being-asked-to-sanitise-wikipedia-entries/
2•rdmuser•32m ago•0 comments

VersionStory: Comparison and Redlining for AI native legal teams

https://www.versionstory.com
1•handfuloflight•33m ago•0 comments

100M homes could be powered by solar projects stuck in permitting

https://waitingforpower.com
1•bdgold•34m ago•0 comments

Show HN: Watch a neural net learn Clash Royale defense in the browser

https://itzik123.github.io/ClashRoyaleAi/lab/
1•itzikkatz•39m ago•0 comments

Show HN: Lines of C, Beats QOI

https://github.com/OzzyMitchell/tinycodec
1•ozzymitchell•50m ago•0 comments

Why AI task-level productivity doesn't translate to organizational throughput

https://pub.towardsai.net/the-hamster-paradox-36dd0d950568
1•younss•50m ago•0 comments

Oversight Has Capacity: Calibrating Agent Guards to a Subjective Fatiguing Human

https://arxiv.org/abs/2606.08919
1•Jimmc414•53m ago•0 comments

Testing 12 different Zigbee temperature/humidity sensors

https://smarthomescene.com/reviews/best-selling-zigbee-temperature-sensors-tested/
1•walrus01•58m ago•0 comments

Changelog to README: testing LLM update strategies

https://codecut.ai/readme-update-from-release-notes/
1•khuyentran1401•58m ago•0 comments

Meeting Buddy – A Cute Mascot That Parachutes in Before Your Meetings (macOS)

https://apps.apple.com/us/app/meeting-buddy-tiny-companion/id6811563656?mt=12
1•xuho•1h ago•0 comments

Gentle AI: AI Coding Ecosystem

https://gentle-ai.gentlemanprogramming.com/
1•OlivOnTech•1h ago•0 comments

Show HN: The Livability Map of Japan

https://kodawari.nimikko.co.jp/
1•asutekku•1h ago•1 comments

Organic Driven Development

https://github.com/stir084/organic-driven-development/blob/main/README.md
2•OlivOnTech•1h ago•0 comments

Why don't more developers "use the platform"?

https://nolanlawson.com/2026/10/03/why-dont-more-developers-use-the-platform/
36•vinhnx•1h ago•18 comments

What's the Future for Pure Math Research in the Age of AI? [Wolfram]

https://www.youtube.com/watch?v=gPrWX8i1htM
1•agnosticmantis•1h ago•0 comments

Show HN: SuperLocalMemory 4.0 "Governed Memory Operating System for AI Agents"

https://arxiv.org/abs/2608.08253
2•vpbhardwaj•1h ago•0 comments

Open ADS-B Telemetry and Flight Dynamics Registry for Flydubai FZ1073

https://evgeny1971.github.io/fz1073-investigation/
1•genvinnikov•1h ago•0 comments

Call It Evil: Understanding the Trump Era

https://wwnorton.co.uk/books/9781324131045-call-it-evil
2•hkhn•1h ago•0 comments