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

Comments

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

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

to:

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

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

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

Oh and maybe cherry-pick

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

Meta Ray-Ban Display: A Breakthrough Category of AI Glasses Quest Blog Store

https://www.meta.com/en-gb/blog/meta-ray-ban-display-ai-glasses-connect-2025/
1•pastorenick•1m ago•1 comments

DeepSeek-R1 incentivizes reasoning in LLMs through reinforcement learning

https://www.nature.com/articles/s41586-025-09422-z
1•Anon84•3m ago•0 comments

Java 25, Ready to Perform to the Limit

https://hanno.codes/2025/09/16/heres-java-25/
1•gm678•4m ago•0 comments

The Economic Impacts of AI: A Multidisciplinary, Multibook Review [pdf]

https://kevinbryanecon.com/BryanAIBookReview.pdf
1•mathattack•7m ago•0 comments

The Mystery of England's Oldest Name

https://www.youtube.com/watch?v=yg-JaPCjq4c
1•Apocryphon•10m ago•0 comments

What do you guys think about Gaussian Splats?

1•Arun_Kurian•13m ago•0 comments

Ask HN: How to be ambitious/hungry again?

1•Poomba•20m ago•0 comments

Intermountain West

https://en.wikipedia.org/wiki/Intermountain_West
1•thunderbong•22m ago•0 comments

Show HN: The first part of my blog is being validated by Anthropic's new report

https://www.mandar.cloud/blog.html
1•mandarwagh•23m ago•0 comments

ArXiv URL Drop in for Markdown

https://markxiv.org/
1•tonydco•28m ago•1 comments

Chinese Typewriter

https://www.youtube.com/watch?v=yNoWMaOyWHY
1•skogstokig•32m ago•0 comments

Towards a Physics Foundation Model

https://arxiv.org/abs/2509.13805
2•NeoInHacker•33m ago•0 comments

Howl.com (With apologies to Allen Ginsburg) (2000)

https://www.salon.com/2000/03/22/howl/
1•phendrenad2•35m ago•0 comments

To do list CLI that feels like Git

https://www.tm-cli.com/
1•ethantrang•35m ago•1 comments

Aaron Swartz: Providing APIs (2013)

https://en.wikisource.org/wiki/A_Programmable_Web/Chapter_5
2•aragonite•41m ago•0 comments

Parents buy bulletproof backpack shields to protect kids from school shooters

https://abc7.com/post/parents-buy-bulletproof-backpack-shields-protect-kids-school-shooters-amid-...
6•lxm•48m ago•4 comments

Show HN: XSched, a scheduling framework for multitasking over diverse XPUs

https://github.com/XpuOS/xsched
1•JialongLiu•50m ago•0 comments

We've officially found 6k exoplanets, NASA says

https://www.space.com/astronomy/exoplanets/weve-officially-found-6-000-exoplanets-nasa-says-were-...
4•cryptoz•52m ago•0 comments

Battling a rare brain-eating disease in an Indian state

https://www.bbc.com/news/articles/c79ven0xxyqo
2•breve•55m ago•0 comments

Numbers Station

https://en.wikipedia.org/wiki/Numbers_station
1•acconrad•55m ago•0 comments

Isaac 0.1 – Perception for the Physical World

https://marketing.perceptron.inc/blog/introducing-isaac-0-1
1•simonpure•1h ago•0 comments

Athletics can't keep kidding itself – it needs a plan to save track and field

https://www.theguardian.com/sport/2025/sep/09/athletics-save-track-and-field-social-media-noah-ly...
1•PaulHoule•1h ago•0 comments

Making LLMs more accurate by using all of their layers

https://research.google/blog/making-llms-more-accurate-by-using-all-of-their-layers/
1•emschwartz•1h ago•0 comments

UC Berkeley gives personal information for 150 students and staff to government

https://www.dailycal.org/news/campus/uc-berkeley-turns-over-personal-information-of-more-than-150...
97•pabs3•1h ago•38 comments

"The Falling Man," 20 Years Later

https://www.theringer.com/2021/09/08/national-affairs/tom-junod-falling-man-press-box-interview-9-11
1•gmays•1h ago•0 comments

SGS-1: a foundational model for CAD

https://www.spectrallabs.ai/research/SGS-1
1•rickcarlino•1h ago•0 comments

Is In-Context Learning Learning?

https://arxiv.org/abs/2509.10414
2•simonpure•1h ago•0 comments

A QBasic Text Adventure Still Expanding in 2025

https://the-ventureweaver.itch.io/
4•ATiredGoat•1h ago•1 comments

Boosting Model Performance with Reinforcement Fine-Tuning

https://hpc-ai.com/blog/Boost_Model_Performance_with_RFT
1•HappyTeam•1h ago•1 comments

Show HN: The text disappears when you screenshot it.

https://unscreenshottable.vercel.app/?text=Hello
13•zikero•1h ago•10 comments