Hacker News new | past | comments | ask | show | jobs | submit login

You may be doing it "wrong".

My old Perforce workflow: code, code, code, code, code, code, code, code, commit

My new Git workflow: code, commit, code, commit, code, commit, code, commit, code, commit, code, commit, push

It's the difference between single-piece flow and large-batch production in Lean Manufacturing.




This, and branches. I rarely used branches in svn, but I branch all the time in git locally.

If you try to use git like svn, it's pretty frustrating. Seems like a lot of work for no gain. But if you embrace the git philosophy of commit early and often and local feature branches, you'll understand how git got so popular.

In svn, I often run into the situation where I'm working on a new feature, want to save what I've done (because it works), but it's not ready to check into the central repo. Then I usually do something that breaks the whole thing locally, but I have no way of undoing that change since nothing has been committed yet. I've seen svn users copy and paste entire directories just to "snapshot" their work. With git and local commits, you don't have this problem. You "save" your progress as you go along by committing it locally and when something breaks, you revert locally. Then when your feature is ready, you push the whole thing to the central repo.


> My new Git workflow: code, commit, code, commit, code, commit, code, commit, code, commit, code, commit, push

Likewise, but mine frequently looks like this: branch, code, commit, code, commit, code, commit, rebase -i, rebase branch on master, code, commit, rebase branch on master, merge, push.


Except "commit" means different things between the two examples. From the perspective of the rest of the team, they are both code+, push.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

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

Search: