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

git init .

git add file

git commit -am "my message"

Pretty simple really. You don't need to think about staging if you don't want to.




Is that a typo or intentional? If you did git add, you don't want commit -a, right?


"git add" is used in this context to add an untracked file (like the fossil example).

git init .

vi file (initial content)

git add file

git commit -am "first commit"

vi file (make changes)

git commit -am "second commit"

Basically if you use commit -am, you never have to worry about staging - which is most of the time imo. In the rare case where you want to avoid committing something that has changed use git add to stage individual files.


I believe these were supposed to map to what its parent comment has listed.




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

Search: