I have lots of git aliases... some in git config and others in bash_profile.
The one I find the most useful is for checking diff of commits between two branches.
But regarding your first alias, I’d like to raise attention that you should review what you’re committing and an alias as you’ve described may prevent less experienced developers from reviewing changes before committing.
There’s another problem with aliases... when you have to work on a machine that’s not yours, you won’t know how... unless you configure your aliases.
I’m not against aliases, I have some myself.
Just sharing concerns for others to see and consider.
Best.
Thanks for your concern. I agree that we should check the differences before committing. This step is done after we check everything. We can do it in the editor like VSCode or through the alias: gs and gd.
I always use git add -p when I want to commit. It will go through each chunk of changes and ask if I want to add it or not. It’s a great way to review what you are going to commit, spot and skip some leftover debugging code, and it allows you to make smaller commits at the same time.
You can even edit the patch before adding it, which is daunting at first but can be quite convenient to quickly omit a leftover print statement in the middle of an otherwise valid change.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I have lots of git aliases... some in git config and others in bash_profile.
The one I find the most useful is for checking diff of commits between two branches.
But regarding your first alias, I’d like to raise attention that you should review what you’re committing and an alias as you’ve described may prevent less experienced developers from reviewing changes before committing.
There’s another problem with aliases... when you have to work on a machine that’s not yours, you won’t know how... unless you configure your aliases.
I’m not against aliases, I have some myself.
Just sharing concerns for others to see and consider.
Best.
Thanks for your concern. I agree that we should check the differences before committing. This step is done after we check everything. We can do it in the editor like VSCode or through the alias: gs and gd.
I always use
git add -p
when I want to commit. It will go through each chunk of changes and ask if I want to add it or not. It’s a great way to review what you are going to commit, spot and skip some leftover debugging code, and it allows you to make smaller commits at the same time.You can even edit the patch before adding it, which is daunting at first but can be quite convenient to quickly omit a leftover print statement in the middle of an otherwise valid change.