My personal preference is to git add ... -p. Eyeballing each line as I commit it gives me one last sanity check.
git add ... -p
I also like to git commit -v so I can refer to the code whilst writing the commit message.
git commit -v
One thing I do a lot is that I like to create a new branch for even the smallest of changes. If I find I need to further prepare for that change, I can create a new branch from master, make the change then head back to the original new branch and rebase.
I also git reset --hard a lot. And, git commit --fixup ... helps me keep my commits tidy but I know if I'm using it a lot, I'm on my way to a mess.
git reset --hard
git commit --fixup ...
You look like an advanced user @updated_tos
, do you have a tutorial reference please ?
These are things I've picked up as I've gone along. I got burnt by git too often when I started out.
tbh I first follow the official documentation in any technology I use and in this case my steps are taken from the official hello world and I didn't change it from the beggining just learned to git add . and always work on the master branch which is not the best as i see in our discussion here
And I just noticed that it is said :
After that it's all about how to commit so it's why I titled this post "How do you commit in GitHub" to start a discussion and to go ahead easy
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.