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, QWERTY, and US Healthcare

https://panthema.net/2026/0318-Vibe-Coding-QWERTY-and-US-Healthcare/
1•srom•2m ago•0 comments

PFnet UN in action Solomon Islands (2005) [video]

https://www.youtube.com/watch?v=Xtuo3m-hGTE
1•joebig•5m ago•0 comments

Study finds that we could lose science if publishers go bankrupt (2024)

https://arstechnica.com/science/2024/03/study-finds-that-we-could-lose-science-if-publishers-go-b...
1•jruohonen•7m ago•1 comments

Systemd's New Feature Brings Age Verification Option to Linux

https://itsfoss.com/news/systemd-age-verification/
1•pera•12m ago•1 comments

I built a trend tracker that scans GitHub, HN, YC, SO, OpenAlex, and SEC filings

https://inqvey.com/trends
2•yarasheff•13m ago•0 comments

I built a tool that visualises GitHub repos as dependency graphs

https://github.com/lucyb0207/CodeAtlas
1•lucyb0207•15m ago•1 comments

Show HN: Agent skills for generating structured visuals with MotionCanvas

https://github.com/VideoZero/skills
1•prathje•20m ago•0 comments

FTC Should Develop Privacy-Protective Age Assurance Standards

https://epic.org/press-release-ftc-should-develop-privacy-protective-age-assurance-standards-lead...
1•geox•23m ago•0 comments

Molly holzschlag – 30 years of blog

https://mollyholzschlag.com/
1•vietyork•29m ago•0 comments

Musk found liable to Twitter shareholders in fraud lawsuit over $44B takeover

https://www.reuters.com/sustainability/boards-policy-regulation/musk-found-liable-twitter-shareho...
2•gostsamo•34m ago•0 comments

What AI augmentation means for technical leaders – Birgitta Boeckeler

https://www.youtube.com/watch?v=qB7rsbDfmQg
2•mcp_•34m ago•0 comments

A Markdown textfile based Kanban board in a single HTML file

https://github.com/chr15m/kanban-todo
2•chr15m•36m ago•2 comments

The easiest way to make the world smarter [video][30m]

https://www.youtube.com/watch?v=XRcwwZXJ8gk
1•Bender•37m ago•0 comments

NPM Visual Manager – a visual dependency manager for VS Code

https://github.com/luisssc/npm-visual-manager
1•luicc•39m ago•0 comments

I'm Sorry Did You Say Street Magic

https://en.wikipedia.org/wiki/I%27m_Sorry_Did_You_Say_Street_Magic
2•doener•41m ago•1 comments

Atuin v18.13 – better search, a PTY proxy, and AI for your shell

https://blog.atuin.sh/atuin-v18-13/
7•cenanozen•48m ago•0 comments

AI Slop Is Infiltrating Online Children's Content

https://undark.org/2026/03/20/ai-slop-children/
5•jruohonen•49m ago•0 comments

Tech Interview guide – the test without tests

http://opentranscripts.org/wp-content/uploads/2016/12/allison-parrish-programming-forgetting-04.png
1•anong1•54m ago•0 comments

Big Win for Open Source as Germany Backs Open Document Format

https://itsfoss.com/news/germany-digital-stack-mandate/
4•giuliomagnifico•54m ago•1 comments

Apple: Accelerate your machine learning workloads with the M5 and A19 GPUs

https://www.youtube.com/watch?v=wgJX1HndGl0
3•de_aztec•54m ago•0 comments

Etel-Tuning

https://etel-tuning.com/
2•mqus•57m ago•0 comments

I benchmarked managed Kubernetes across 31 EU providers – here's what I found

https://www.eucloudcost.com/blog/building-eucloudcost/
1•mixxor•1h ago•0 comments

Show HN: YoloAI: A sandbox and diff/apply workflow your agent can't escape

https://yoloai.dev/posts/the-only-sandbox-claude-cant-escape/
1•kstenerud•1h ago•0 comments

Show HN: World Time TUI

https://github.com/aleris/woti
1•realaleris149•1h ago•0 comments

Internet course on circuit theory using TINA

https://www.tina.com/free-dc-ac-course/
1•teleforce•1h ago•0 comments

Pydantic-Deep: Production Deep Agents for Pydantic AI – Vstorm

https://pydantic.dev/articles/pydantic-deep-agents
1•rbanffy•1h ago•0 comments

Show HN: Shareaslot Is a Doodle Alternative

https://shareaslot.com/
1•theill•1h ago•0 comments

Study: An AI decoded the rules of an ancient board game

https://news.flinders.edu.au/blog/2026/03/21/ai-sheds-light-on-an-ancient-gaming-mystery/
1•giuliomagnifico•1h ago•0 comments

Show HN: Live-Typing Chat

https://kraa.io/kraa/trees
2•levmiseri•1h ago•0 comments

Microscope (Role-Playing Game)

https://en.wikipedia.org/wiki/Microscope_(role-playing_game)
1•doener•1h ago•0 comments