logoalt Hacker News

dansmith1919today at 7:19 PM3 repliesview on HN

This has bothered me ever since I was using git for the first time: what do you mean I have to 'add' and 'commit' and then 'push'? I just want to save my stuff, this is SO many steps.


Replies

j_wtoday at 8:50 PM

These criticisms of git always seems so shallow to me.

'add' tells git to start tracking some file(s)

'commit' tells git to save the currently tracked files

'push' says "upload my changes to some other location." Git isn't dropbox magically 'rsync'ing the directory to some server.

'pull' says "download any changes from some other location." Same deal as push.

That should satisfy the majority of git casuals that get frustrated with it. You should learn the tools of your trade, and version control (specifically git) is one of the tools of the software trade. If you work adjacent to software why is it so hard to learn a little about git?

yjftsjthsd-htoday at 7:52 PM

You don't have to do add as a separate step unless you're adding it to the repo for the first time. You can (and I do) just `git commit file1 dir2` or whatever. I don't conceptually think commit+push should be combined; committing a version is separate from pushing it to a remote.

show 1 reply
abustamamtoday at 7:59 PM

When I was getting started with programming I often forgot to do one of those steps and often ended up losing my work because I was working from a library computer or something.

When I got more experience I finally understood why it is like that, and it makes sense now, but its still a lot of steps for someone learning to remember.