DEV Community

Discussion on: Handy Git Commands and practices to improve your workflow

Collapse
 
neurovelho profile image
Teemu Hirvonen

That's a very nice list! The bit about descriptive commit messages and pull requests is especially important. It's not very nice navigating a codebase where half the commits are "updated stuff" and "implemented thingamajig".

Here's a couple of more commands if you want to show off a bit to other developers in your team (or maybe make your and your teams lives a bit easier 😄):

$ git config --global alias.co checkout
Enter fullscreen mode Exit fullscreen mode

Comes in pretty handy if you're tired of having to write git checkout [branch] every time you want to change branches. Can just do git co [branch]. You can of course create aliases for other stuff like commit, etc.

Another cool command is rebase. Many people use it mainly for rebasing master onto a feature branch but you can also use it for cleaning up commits on your feature branch. Here's a pretty cool article showing how to do it.

Collapse
 
tngeene profile image
Ted Ngeene

Thanks! I didn't know this. I tried it out and works like a charm!