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

Comments

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

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

to:

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

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

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

Oh and maybe cherry-pick

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

Athena: First cross-domain behavioral foundation model

https://markopolo.ai/newsroom/athena/
1•djshah•2m ago•0 comments

LightProto: Zero-alloc Protobuf for Java, up to 8x faster than Google's protobuf

https://github.com/streamnative/lightproto
1•matteomerli•2m ago•0 comments

Show HN: Anduin – A fast cross platform Git diff viewer inspired by Magit

https://github.com/ishanray/anduin
1•ishanr•3m ago•0 comments

Cell phone radiofrequencies make mice and rats live longer

https://github.com/zanekoch/airpods-go-brrrrr
1•LouisLazaris•4m ago•0 comments

Owesa. Professional Networking

https://www.owesa.com/
1•kelsey-owesa•9m ago•1 comments

The BIP

https://casey.github.io/blog/the-bip/
1•greyface-•9m ago•0 comments

UAE temporarily closes airspace as Middle East war forces flight disruptions

https://www.cnbc.com/2026/03/17/uae-airspace-closure-dubai-airport-drone-strike-middle-east-fligh...
1•petethomas•11m ago•0 comments

Show HN: Atlas for Laravel v2.5 Released

https://github.com/atlas-php/atlas
1•tmarois•14m ago•0 comments

Speeding up HTML generation by 2000%

https://bobrubbens.nl/post/speeding-up-html-generation-2000/
1•PaulHoule•16m ago•0 comments

How to Talk to Computers

https://a11ce.com/talk-to-computers.html
1•kawelea•17m ago•0 comments

Manifesto on Symbiosis: A New Paradigm for Civilization Part II

1•acehs•18m ago•0 comments

Enterprise for OpenBAO – Open Source HashiCorp Vault alternative

https://control-plane.io/enterprise-for-openbao/
1•donutshop•19m ago•0 comments

Building an Analogue Computer to Simulate Neurons

https://hackaday.com/2026/03/08/building-an-analogue-computer-to-simulate-neurons/
1•pilingual•25m ago•0 comments

Generalising the Fast Reciprocal Square Root Algorithm (2023)

https://arxiv.org/abs/2307.15600
1•adampunk•26m ago•1 comments

The future of Amazon coders is the present of Amazon warehouse workers

https://pluralistic.net/2025/03/13/electronic-whipping/
14•martin-t•28m ago•1 comments

An engineering thesis disguised as a coupe: A history of the Honda Prelude

https://arstechnica.com/cars/2026/03/an-engineering-thesis-disguised-as-a-coupe-a-history-of-the-...
3•ProAm•28m ago•0 comments

Show HN: 1k desktop beats vendor sparse library 474× on Mistral-7B

https://rolv.ai/
1•heggenhougen•30m ago•0 comments

The Self-Defeating Prophecy (and How It Works)

https://unintendedconsequenc.es/the-self-defeating-prophecy/
1•paulorlando•30m ago•0 comments

Show HN: Skill-Crypt – encrypted skill sharing between AI agents over XMTP

https://github.com/skillcrypt-alt/skill-crypt
1•skillcrypt•32m ago•0 comments

She Hoped Ketamine Would Rewire Her Brain. She Didn't Live to See It Work

https://www.wsj.com/health/wellness/ketamine-telehealth-dangers-4a7bc8da
1•fortran77•33m ago•1 comments

More transparency and control over Gemini API costs

https://blog.google/innovation-and-ai/technology/developers-tools/more-control-over-gemini-api-co...
1•y1n0•35m ago•0 comments

FriendHike – Social hiking platform for finding trails and hiking partners

https://friendhike.com
1•renatello•35m ago•1 comments

The emdash of vibecoded UIs

https://twitter.com/allgarbled/status/2033698785529082144
2•ramoz•37m ago•0 comments

NVIDIA's new DLSS 5 drops with uncanny AI filters

https://www.windowscentral.com/gaming/nvidias-new-dlss-5-drops-with-uncanny-ai-filters-and-youtub...
2•FroshKiller•38m ago•0 comments

$1 API architecture to use in new ideas

https://imgur.com/a/Z3iZene
1•lucastonelli•38m ago•1 comments

Just when you thought the chip shortage was ending wafers until 2030

https://www.reuters.com/world/asia-pacific/south-koreas-sk-group-chairman-expects-chip-wafer-shor...
1•Horatius77•40m ago•2 comments

Show HN: TLA PreCheck – TS DSL that proves state machines via TLA+

https://github.com/kingbootoshi/tla-precheck
2•bootoshi•42m ago•0 comments

Trump asking for China's warships to help in opening of Strait of Hormuz

https://finance.yahoo.com/news/trump-call-chinese-warships-hits-110000824.html
5•mandeepj•42m ago•1 comments

AI can guess gay or straight from photographs, with 91% accuracy (2017)

https://www.theguardian.com/technology/2017/sep/07/new-artificial-intelligence-can-tell-whether-y...
1•maxloh•46m ago•0 comments

Video Encoding and Decoding with Vulkan Compute Shaders in FFmpeg

https://www.khronos.org/blog/video-encoding-and-decoding-with-vulkan-compute-shaders-in-ffmpeg
1•y1n0•51m ago•0 comments