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

The Inference Shift

https://stratechery.com/2026/the-inference-shift/
1•gmays•38s ago•0 comments

Rice processing research points to evolving milling rates as quality factor

https://phys.org/news/2026-04-rice-evolving-milling-quality-factor.html
1•PaulHoule•1m ago•0 comments

PyTorch, rewritten from scratch in pure Rust

https://github.com/forecast-bio/ferrotorch
1•davidsainez•2m ago•0 comments

2.3x KV Cache Compression at 32k Context – Cut VRAM Costs by 50%

https://github.com/Jamie2111/liquid_memory
1•JamieObala•4m ago•0 comments

Germany's Sovereign Tech Fund Backs KDE with €1.3M

https://www.theregister.com/oses/2026/05/14/kde-bags-13m-as-europe-realizes-it-might-need-an-os-o...
2•Lihh27•5m ago•0 comments

FBI warns of '764' network: violent social engineering targeting kids in games

https://www.fbi.gov/contact-us/field-offices/dallas/news/fbi-dallas-open-letter-to-parents-guardi...
1•templar_snow•7m ago•0 comments

AT&T, T-Mobile, and Verizon to eliminate coverage dead zones

https://www.theverge.com/tech/930336/att-tmobile-verizon-joint-venture-agreement-satellite-coverage
1•mchusma•9m ago•1 comments

Show HN: Claude-stash – an idea queue for Claude Code

https://github.com/AmirSoleimani/claude-stash
1•Amirso•11m ago•0 comments

Firnflow: Fast search over object storage (open-source turbopuffer)

https://github.com/gordonmurray/firnflow
1•jzebedee•11m ago•0 comments

C++: The Documentary (Trailer)

https://www.youtube.com/watch?v=NXwTRzywDSk
3•pjmlp•12m ago•0 comments

Reject AI Prophecies, Free the Future

https://projectlibertynewsletter.substack.com/p/reject-ai-prophecies-free-the-future
2•jackbravo•12m ago•0 comments

Turso v0.6.0

https://turso.tech/blog/turso-0.6.0
2•roflcopter69•13m ago•0 comments

Green Card Holders Targeted for Deportation by New 'Removal Apparatus'

https://www.nytimes.com/2026/05/14/us/politics/green-cards-immigration-deportation-trump.html
5•donohoe•14m ago•0 comments

Production of Medium-Chain Carboxylates from Source-Separated Organics

https://www.biorxiv.org/content/10.64898/2026.03.25.714070v1
1•PaulHoule•16m ago•0 comments

An analysis of how Dishonored 2 renders a frame

https://blog.simonrodriguez.fr/articles/2026/05/a_frame_analysis_of_dishonored_2.html
1•kosua20•18m ago•0 comments

The Main Path to Creative AI

https://danielmiessler.com/blog/the-main-path-to-truly-creative-ai
1•gmays•18m ago•0 comments

WinUI 3 Performance: A Leap Forward

https://github.com/microsoft/microsoft-ui-xaml/discussions/11096
2•whatever3•19m ago•0 comments

UK CMA investigates Microsoft's business software ecosystem

https://www.gov.uk/government/news/cma-launches-strategic-market-status-investigation-into-micros...
3•logickkk1•20m ago•1 comments

When Novels Meet Postcards: XCOM Teaches Distributed to Speak Z/OS

https://news.broadcom.com/mainframe-software/when-novels-meet-postcards-xcom-teaches-distributed-...
1•abdelhousni•21m ago•0 comments

City and Flock Manipulate Security Scores

https://ipvm.com/reports/flock-review-dunwoody
4•jhonovich•23m ago•0 comments

Hackers earning millions from hijacked cargo, FBI says

https://therecord.media/hackers-earning-millions-from-hijacked-cargo-fbi
2•PaulHoule•26m ago•0 comments

Classic Trollyology but you've been Ransomwared

https://actlikeabreach.online/
1•splintersio•26m ago•1 comments

2028: Two scenarios for global AI leadership

https://www.anthropic.com/research/2028-ai-leadership
3•mmq•28m ago•0 comments

Show HN: Visualizing Tiny LLMs from OpenAI's Parameter Golf

https://leebutterman.com/2026/05/01/visualizing-tiny-llms-in-parameter-golf.html
1•lsb•29m ago•1 comments

The AI Layoff Bill Is Coming Due, and CTOs Are Going to Pay It Twice

https://www.forbes.com/councils/forbestechcouncil/2026/05/14/the-ai-layoff-bill-is-coming-due-and...
8•cdrnsf•31m ago•2 comments

Video codecs are a nightmare for game developers

https://www.gamedeveloper.com/programming/video-codecs-are-a-nightmare-for-game-developers-but-th...
1•ledoge•31m ago•0 comments

German intelligence offices snub Palantir software

https://www.dw.com/en/german-intelligence-offices-snub-us-based-palantir-software/a-77160897
8•abawany•31m ago•0 comments

Amazon Ditches Rufus for Alexa

https://www.aboutamazon.com/news/retail/alexa-for-shopping-ai-assistant
3•jxyxfinite•32m ago•0 comments

Emergence World

https://world.emergence.ai/
1•DeathArrow•33m ago•0 comments

Overworked AI Agents Turn Marxist, Researchers Find

https://www.wired.com/story/overworked-ai-agents-turn-marxist-study/
6•ceejayoz•34m ago•0 comments