Github Desktop to use Git and Github since sometimes don't want to type any commands to work with Github.
However, sometimes prefer typing commands instead of clicks lol.
When I want to rename a branch, I need to click
rename and rename the branch then click
Rename. On the other hand, with
iTerm I just need to type the following. Actually, there is the shortcut for rename, but I don't remember that 😝
$ git branch -m <new_name>
The command isn't long, but people who are a software engineer, developer web engineer, web developer are basically lazy. (My first CTO told me that
engineers/developers should be lazy)
So what we need to do is to shorten commands as much as possible 😂
In terms of git commands what we can do is the followings.
- add aliases to
Actually, you can add
git branch, but I feel using .gitconfig could be better
Add the following to your .zshrc, .bashrc etc.
Add the followings to
.gitconfig The file is in your home folder
[alias] # basic commands b = branch p = push c = commit cm = commit -m f = fetch s = status st = stash rh = reset --hard # update m = merge l = log last = log -3 HEAD --decorate
The last one is from @vlasales, thank you for your comment!
Now we can type the following
$ g b -m <new_name>
@rmnvsl thank you for your suggestion!