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•8mo ago

Comments

epmatsw•8mo ago
restore and maybe switch are the two missing ones I think. Rebase for me, but that’s preference. Cherry-pick too.
rentonl•8mo ago
my co-workers used to think I was an expert in git. In reality, they memorized 7 commands while I memorized 15
hbogert•8mo ago
i memorized that a commit tree is a ordered set of patches. Everything goes from there.
Areibman•8mo ago
In similar fashion, this site has saved me countless hours fixing common git issues https://ohshitgit.com
the__alchemist•8mo ago
I need to alias:

  git add .
  git commit -am "descriptive name"
  git push

to:

  git sync "descriptive name"
horsawlarway•8mo 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•8mo 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•8mo 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•8mo ago
That sounds better but I like the granularity I get from scrutinizing specific files or the patch takes too long to review.
speff•8mo 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•8mo 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•8mo 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•8mo ago
Maybe not essential, but reflog is invaluable.

I also like to separate fetch from pull (fetch + merge).

foobarkey•8mo ago
Remove merge and add rebase and we agree :)

Oh and maybe cherry-pick

seba_dos1•8mo ago
Both are essential.
realaleris149•8mo ago
There are other commands?
incomplete•8mo 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•8mo ago
i can't take this seriously if there's no mention of the '--amend' option and 'rebase' command
OutOfHere•8mo ago
It missed "git switch" and "git restore".

Ancient infection disabled gene in chimp brains that remains expressed in humans

https://www.thetransmitter.org/evolution/viral-remnant-in-chimpanzees-silences-brain-gene-humans-...
1•jakewins•59s ago•0 comments

I quit tech today, warning to junior and mid-level devs

https://old.reddit.com/r/nairobitechies/comments/1qml2xr/i_quit_tech_today_warning_to_junior_and_...
1•nomilk•1m ago•0 comments

Show HN: WhyFi – Figure out why your Wi-Fi is bad and fix it

https://whyfi.network/
2•drpancake•1m ago•0 comments

Doom in the Terminal

https://github.com/wojciech-graj/doom-ascii
1•nateb2022•1m ago•0 comments

Show HN: Build Web Automations via Demonstration

https://www.notte.cc/launch-week-i/demonstrate-mode
3•ogandreakiro•2m ago•0 comments

Show HN: Lichess.el – Play Lichess Inside Emacs

https://github.com/tmythicator/lichess.el
1•atimcha•2m ago•1 comments

Digital Excommunication

https://pgaleone.eu/europe/2026/01/27/digital-excommunication/
1•me2too•3m ago•0 comments

Show HN: MonsterWriter – An Overleaf Alternative with a Better Free Plan [video]

https://www.youtube.com/watch?v=feWZByHoViw
1•WolfOliver•3m ago•0 comments

Generate HTTP server and client from protobuf

https://github.com/MUlt1mate/protoc-gen-httpgo
1•MUlt1mate•4m ago•0 comments

Apple's AirTag 2 is easier to find thanks to new chip

https://arstechnica.com/gadgets/2026/01/apple-introduces-new-airtag-with-better-range-and-a-loude...
1•taubek•4m ago•0 comments

A proposal to prevent job losses from AGI

https://invertedpassion.com/a-proposal-to-prevent-job-losses-from-agi/
1•speckx•4m ago•0 comments

TikTok users can't upload anti-ICE videos. The company blames tech issues

https://www.cnn.com/2026/01/26/tech/tiktok-ice-censorship-glitch-cec
3•kotaKat•6m ago•0 comments

TikTok Earning Automation System

https://fluxzap.com/tiktok-money-making-system/
1•taimurkazmi•7m ago•1 comments

Show HN: Lenma – A Voice Assistant for macOS

https://lenma.app
1•furkankoseoglu•7m ago•0 comments

"Wildly irresponsible": DOT's use of AI to draft safety rules sparks concerns

https://arstechnica.com/tech-policy/2026/01/wildly-irresponsible-dots-use-of-ai-to-draft-safety-r...
2•pseudolus•7m ago•0 comments

How can I find hackatons hosted by YC?

1•jackota•10m ago•0 comments

You see an email ending in .eu.org. Must be legit, right?

https://blog.castle.io/you-see-an-email-ending-in-eu-org-must-be-legit-right/
1•avastel•11m ago•0 comments

Hart et al. 2025 on neural canal ridges in crocs

https://svpow.com/2025/12/12/new-paper-hart-et-al-2025-on-neural-canal-ridges-in-crocs/
1•surprisetalk•13m ago•0 comments

Metazooa

https://metazooa.com
1•surprisetalk•13m ago•0 comments

Dinosaurpictures.org – Dinosaur Pictures

https://dinosaurpictures.org/
1•surprisetalk•13m ago•0 comments

Clawdbot Renamed to Moltbot

https://github.com/moltbot/moltbot
1•pretext•13m ago•0 comments

Show HN: Trix – A terminal music player written in Rust

https://github.com/RIZAmohammadkhan/TerminalMusicPlayer
1•rixa_•14m ago•0 comments

Performance Reviews Are the Scorecard of Capitalism

https://cate.blog/2026/01/27/performance-reviews-are-the-scorecard-of-capitalism-and-why-that-sho...
1•ingve•14m ago•0 comments

Large Language Models: Field Manual for Epistemic Self-Defense

https://collectivesafetynet.blogspot.com/2026/01/large-language-models-field-manual-for.html
1•trustmarket•14m ago•1 comments

California tech CEO and electric vehicle pioneer arrested, accused of murder

https://www.sfgate.com/bayarea/article/california-tech-murder-arrest-21316366.php
3•smurda•14m ago•0 comments

In vitro implantation with Apple Vision Pro

https://badgar.org/
1•mgl•15m ago•0 comments

Newegg stock price falls 17.7% after Chinese owner is detained by authorities

https://www.tomshardware.com/tech-industry/newegg-stock-price-falls-17-7-percent-after-chinese-ow...
4•speckx•15m ago•0 comments

Show HN: I built a voice-only AI language tutor using OpenAI's Realtime API

https://speaklanguageonline.com
1•digi_wares•16m ago•0 comments

Magical AI Crayons

https://www.brendanmulligan.com/writing/magical-ai-crayons
2•bmulligan•17m ago•0 comments

Pinterest laying off 15% of workforce in push toward AI roles and teams

https://www.cnbc.com/2026/01/27/pinterest-layoffs-stock-ai.html
1•pseudolus•18m ago•0 comments