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

Vibe Coding: Programming for the rest of us?

https://numericcitizen.me/vibe-coding-programming-for-the-rest-of-us/
1•numericcitizen•52s ago•0 comments

Machine Learning: A First Course for Engineers and Scientists

http://smlbook.org/
1•teleforce•3m ago•0 comments

Show HN: Drop – Linux sandboxing for LLM agents and untrusted code

https://github.com/wrr/drop
1•mixedbit•3m ago•0 comments

OpenAI models answer an older prompt instead of the current one

https://www.vincentschmalbach.com/openai-models-answer-an-older-prompt-instead-of-the-current-one/
1•vincent_s•3m ago•0 comments

Welfare on Wheels: The Truth About the Supposed Truck Driver Shortage

https://reason.com/2026/03/24/welfare-on-wheels/
1•mhb•4m ago•0 comments

Reader mode Chrome extension with cross-device sync – no account needed

https://wushu75.github.io/readr/
1•Ogbon•4m ago•0 comments

Show HN: Off By – a daily game about how wrong we are about the American economy

https://offby.io
1•offby99•5m ago•0 comments

Chat Control: How EU and the Tech Lobby Are Trying to Overturn Parliament's Vote

https://www.patrick-breyer.de/en/the-battle-over-chat-control-how-eu-governments-and-the-tech-lob...
2•nickslaughter02•5m ago•1 comments

T-shirt Driven Development

https://seongminpark.com/t-shirt-driven-development/
1•boodleboodle•6m ago•0 comments

The Authority of Thought

https://harpers.org/archive/2026/04/the-authority-of-thought-pankaj-mishra/
1•jbegley•7m ago•0 comments

A New Global Botnet (Jackskid) Generating Tbps of DDoS

https://github.com/deepfield/public-research/blob/main/jackskid/report.md
1•lakoshi•7m ago•0 comments

How I started with repairs

https://posts.joedmin.cz/posts/how-i-started-with-repairs/
1•lapity_lapoty•9m ago•0 comments

Electricity is eating the world. Is it time for an American Shenzhen?

https://www.darkmatter.blog/articles/electricity-is-eating-the-world-is-it-time-for-an-american-s...
1•jbegley•9m ago•0 comments

The Dark Matter of Hardware Engineering

https://darkmatter.blog/articles/dark-matter-of-hardware
1•jbegley•10m ago•0 comments

Board games, cognitive decline and dementia

https://pmc.ncbi.nlm.nih.gov/articles/PMC3758967/
1•RickJWagner•13m ago•0 comments

Show HN: Forecast Planner, personal finance app that forecasts instead of tracks

https://www.forecast-planner.com/
1•curiousweb•14m ago•0 comments

From Chile to the Philippines, meet the people pushing back on AI

https://restofworld.org/2026/ai-pushback-chile-mexico-kenya-philippines/
2•Brajeshwar•14m ago•0 comments

Unified RISC-V IP Access Platform

https://openhwgroup.github.io/uap/
1•Tomte•16m ago•0 comments

Secure Domain Name System (DNS) Deployment 2026 Guide [pdf]

https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-81r3.pdf
1•XzetaU8•16m ago•0 comments

Game Devs Reveal All Their Ugly Placeholder Assets Made Without AI

https://kotaku.com/crimson-desert-ai-art-placeholder-game-devs-share-assets-images-genai-2000681053
2•cainxinth•18m ago•0 comments

Vulkanised 2026 talks now available (playlist)

https://www.youtube.com/playlist?list=PLMLurvdlOpWNFlPD0kumIYtivIpUx1V0a
2•pjmlp•19m ago•0 comments

Hung cron jobs: what causes them and how to detect them without a sidecar

https://crontify.com/blog/hung-cron-jobs-detection
2•vincentabolarin•21m ago•0 comments

Static IPv4 address on outbound connections from a Cloud Run Job

https://omnitroid.bearblog.dev/giving-a-docker-container-a-static-ip-on-outbound-connections/
1•OmniTroid•22m ago•0 comments

LiteLLM PyPI has been compromised an hour ago, do not update

https://futuresearch.ai/blog/litellm-pypi-supply-chain-attack/
10•Bullhorn9268•24m ago•3 comments

Tell HN: Litellm 1.82.7 and 1.82.8 on PyPI are compromised

3•dot_treo•24m ago•0 comments

Cardputer-Adv (40€ ESP32-S3): Evil Portal and Deauth Attack, with/Without PMF

https://paolocostanzo.github.io/cardputer-adv-wifi-security/
1•PCostanzo•24m ago•0 comments

Designing a Python Language Server: Lessons from Pyre That Shaped Pyrefly

https://pyrefly.org/blog/lessons-from-pyre/
2•ocamoss•27m ago•0 comments

A Tom-Inspired Agenda for AI Safety Research

https://www.lesswrong.com/posts/2BFifEBfCCWtkGsTp/a-tom-inspired-agenda-for-ai-safety-research
2•joozio•28m ago•1 comments

God, I hate .env files

4•zidoo•29m ago•3 comments

How do you ensure consistency in test results generated via AI models?

1•allenmatthew•30m ago•0 comments