frontpage.
newsnewestaskshowjobs

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

Hiding a Prompt in a Tokenizer

https://stephantul.github.io/blog/prompt/
1•stephantul•1m ago•0 comments

Startup Sells Synthetic Influencers Manipulates Social Media as a Service (2025)

https://www.404media.co/a16z-backed-startup-sells-thousands-of-synthetic-influencers-to-manipulat...
1•Bluestein•1m ago•0 comments

Inside The Fake Copyright Racket Silencing News Outlets

https://www.occrp.org/en/news/i-terminated-this-channel-inside-the-fake-copyright-racket-silencin...
1•robtherobber•2m ago•0 comments

Dactyl – Build real iOS apps just by describing them

https://dactyl.dev/
1•losfair•4m ago•0 comments

Ask HN: When will Trump impose tariffs on semiconductors from Asia?

2•roschdal•4m ago•0 comments

Fast drilldown dashboards from a single Parquet file

https://www.hamiltonulmer.com/customer-dashboards-r2-hyparquet/
1•v3gas•4m ago•0 comments

Ateegnas

https://ateegnas.com
1•Manas2231•4m ago•0 comments

How LLMs remember, schedule, and stream tokens

https://ssenthilnathan3.github.io/blog/kutty-vllm/
1•nathaah3•5m ago•0 comments

Show HN: Structured code review findings on open source repos

https://app.contextgoblin.com/demo/reviews
1•clemens1010•7m ago•0 comments

Grok Bot 0.18 – reconstructed source code

https://github.com/b-nnett/grok-bot-0.18-reconstructed
1•mak8•8m ago•0 comments

How to Compress a PDF for Email Attachments (Under 10MB)

https://www.uselocalpdf.com/blog/how-to-compress-pdf-for-email
1•tvictano•9m ago•0 comments

The Dictionary of Obscure Sorrows: Uncommonly Lovely Invented Words (2024)

https://www.themarginalian.org/2024/04/12/dictionary-of-obscure-sorrows/
1•robtherobber•10m ago•0 comments

The Only Prompting Guide You'll Use

1•writebysachin•10m ago•0 comments

Most AI Work Can Wait

https://tomtunguz.com/ai-execution-routing/
1•walterbell•14m ago•0 comments

Show HN: Cc-context-telemetry – context and rate-limit % in Claude Code's bar

https://github.com/technical-turtle/cc-context-telemetry
1•tech_turtle•15m ago•0 comments

Artists Built a Site to Escape AI. Scrapers Are Coming for It Anyway

https://www.forbes.com/sites/robsalkowitz/2026/08/23/artists-built-a-site-to-escape-ai-scrapers-a...
3•theshrike79•17m ago•0 comments

Hybrid energy system cools and generates electricity and hot water

https://www.heise.de/en/news/Hybrid-energy-system-cools-and-generates-electricity-and-hot-water-1...
2•doener•17m ago•0 comments

Anger, Anxiety and Agency

https://lucumr.pocoo.org/2026/8/24/anger-anxiety-agency/
1•tosh•18m ago•0 comments

Nvidia announces AI-related price hikes

https://www.taipeitimes.com/News/biz/archives/2026/08/24/2003862999
2•mgh2•21m ago•1 comments

The State of Open Source Supply Chain Attacks

https://www.stepsecurity.io/blog/state-of-open-source-supply-chain-attacks
1•varunsharma07•24m ago•0 comments

Engineer earns a year's salary in 2 months by doing RLFH tasks

https://twitter.com/TheBengaluruGuy/status/2091357126409281957
2•TheBengaluruGuy•24m ago•0 comments

Hiring a Car in the UK

https://bluprince13.com/blog/hiring-a-car-in-the-uk
1•bluprince13•25m ago•0 comments

Where did the blades go at Dogger Bank A wind farm?

https://fosstodon.org/@robhawkes/117149337500339989
1•robin_reala•25m ago•0 comments

Show HN: ETLFunnel – A self-hosted, code-first platform for data pipelines

https://etlfunnel.com
1•vivekburman•28m ago•0 comments

The Most Impossible Rise of a City Ever: Phoenix, Arizona [video]

https://www.youtube.com/watch?v=iZ89M98xwZM
2•xeonmc•29m ago•0 comments

An Integrative Appraisal Model of Epistemic Curiosity

https://link.springer.com/article/10.1007/s42761-025-00328-7
1•simonebrunozzi•31m ago•0 comments

Show HN: Using LLMs to make the Emacs Web Browser great again

https://github.com/sstraust/simpleweb
1•sammy0910•31m ago•0 comments

Zero-click vulnerability in Grok allows silent data exfiltration

https://cyberupdates365.com/grok-zero-click-attack-data-theft/
3•sysadmin_diarie•31m ago•0 comments

New daily diabetes pill that helps with weight loss launches in UK pharmacies

https://www.theguardian.com/society/2026/aug/24/daily-diabetes-pill-foundayo-weight-loss-uk-pharm...
1•giuliomagnifico•33m ago•0 comments

CozyClay – browser previs before you burn $17 on another Seedance take

https://github.com/NomaDamas/CozyClay
1•Yun_HDY•35m ago•0 comments