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

PostgreSQL in Gleam with pog, squirrel, and cigogne

https://nulltree.xyz/articles/basic-postgres-setup-in-gleam/
1•todsacerdoti•3m ago•0 comments

Some 20-sided dice from Ptolemaic Egypt (ca.150BC)

https://mathstodon.xyz/@dpiponi/115770670004578550
1•aebtebeten•4m ago•0 comments

Ask HN: How to work with Claude Agent SDK durability?

1•spacemnstr42069•4m ago•0 comments

Fake It – Guess the Imposter

https://fakeitgame.com
1•SFGWisdow•8m ago•1 comments

Catching API regressions with snapshot testing

https://kreya.app/blog/api-snapshot-testing/
1•CommonGuy•10m ago•0 comments

pf: Make af-to less magical

https://undeadly.org/cgi?action=article;sid=20260116085115
2•defrost•10m ago•0 comments

Personal Intelligence: Connecting Gemini to Google Apps

https://blog.google/innovation-and-ai/products/gemini-app/personal-intelligence/
1•thunderbong•11m ago•0 comments

I was a top 0.01% Cursor user. Here's why I switched to Claude Code 2.0

https://blog.silennai.com/claude-code
2•Areibman•12m ago•0 comments

Ask HN: Why do we wait for PR to review obvious slop

1•moshetanzer•12m ago•0 comments

Windows? Linux? Browser? Same Executable

https://hackaday.com/2026/01/15/windows-linux-browser-same-executable/
1•birdculture•16m ago•0 comments

Show HN: GitHub – Burn – Rust tensor library and deep learning framework

https://github.com/tracel-ai/burn
1•criexe•17m ago•0 comments

ACX 2025 prediction contest retrospective

https://entropicthoughts.com/acx-2025-prediction-contest-retrospective
2•kqr•18m ago•0 comments

Software Crisis

https://en.wikipedia.org/wiki/Software_crisis
1•tin7in•19m ago•0 comments

Life Levels – Make choices and see your life in 15 years

https://mathgameshero.com/life-levels/
1•absurdwebsite•25m ago•1 comments

How the New Yorker Became Irrelevant

https://www.persuasion.community/p/how-the-new-yorker-lost-its-soul
2•simonebrunozzi•30m ago•0 comments

What does it mean to be a programming language, anyhow? (2021) [pdf]

https://dl.acm.org/doi/pdf/10.1145/3480947
1•hun3•30m ago•0 comments

Show HN: SharpSkill- Realign markets needs and developers

https://sharpskill.fr/en
1•MakeMilk•33m ago•0 comments

Ask HN: How to keep your product from fading into obscurity

1•alexpham14•35m ago•0 comments

California Gold Smelt [video]

https://www.youtube.com/shorts/f1QdvAl4YKY
2•thunderbong•36m ago•0 comments

You Don't Need an ORM

https://codebeameurope.com/talks/you-don-t-need-an-orm/
2•amalinovic•37m ago•2 comments

Show HN: Control center for Claude Code with plan review and parallel agents

https://www.heymedusa.net/
2•benodiwal•39m ago•0 comments

Bettershot an OSS Alternative of Cleanshot

https://github.com/KartikLabhshetwar/better-shot
2•kartik017•42m ago•0 comments

The Great Online Game

https://www.notboring.co/p/the-great-online-game
2•simonebrunozzi•45m ago•0 comments

AI-bots shall eat my docs

https://discourse.ubuntu.com/t/ubuntu-server-gazette-issue-11-ai-bots-shall-eat-my-docs/75029
2•DanieleProcida•47m ago•1 comments

59% of Republicans favor use of force immigration raids despite risk of deaths

https://www.reuters.com/world/republicans-split-trumps-aggressive-immigration-crackdown-reutersip...
3•willmarch•48m ago•2 comments

Support for C++26 Reflection has been merged into GCC trunk

https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=4b0e94b394fa38cdc3431f3cfb333b85373bd948
2•pjmlp•48m ago•0 comments

Work/life/pet project balance?

3•wiz21c•55m ago•0 comments

Python Basics Explained with Real-World Examples

https://medium.com/@pcodesdev/python-basics-the-complete-beginners-guide-to-programming-in-2026-a...
2•pcodesdev•1h ago•1 comments

Tolkien Society Awards 2026

https://www.tolkiensociety.org/society/awards/
2•BerislavLopac•1h ago•0 comments

KerasHub: a pretrained modeling library

https://keras.io/keras_hub/
2•saikatsg•1h ago•0 comments