Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In git committing and pushing are two different things. With git you have a copy of the repo, as does anyone else who checks it out. Think of each repo like its own little svn server, everyone has one locally. So you can commit to that and yes no one has access (unless you open it up to them, but no need to complicate this). So you can commit your unfinished work without other people seeing it, and still have history to be able to go back if necessary. Then when it's ready you can push that back to the shared repo.

Branching in git is really cheap and easy compared to svn. A good way to work to always branch before starting anything. Work on that branch, commiting whenever you feel like. You don't need to push that branch unless someone else wants to work on the unfinished feature with you, or needs something from it before it is ready. In the meantime if the mainline moves on ahead you can just keep merging it into your feature branch to get the new changes. When it's ready you can then merge it back into the mainline and push that.



I'm missing where you answered his question. He's talking about sharing his latest edit to his other machines, which aren't permanently network connected, without creating an explicit git version.


> You don't need to push that branch unless someone else wants to work on the unfinished feature with you, or needs something from it before it is ready.

If you want to share a commit that isn't ready, it really should go on a feature branch and not the mainline. Then you can squash it into a real commit when its ready.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: