DEV Community

Discussion on: Git single command executor

Collapse
 
cabbage profile image
cab

So, first of all. I don't like shortcuts for just adding all changes & pushing them immedietly. IMHO - unless you review every change beforehand - this is bad practise. git add --interactive is a great builtin tool to review your changes before committing them.

Then most of the quick-command cand be done with git aliases which do note require a whole node process.
Here is an example from my global git-config:

[alias]
  amend = commit --amend
  co = checkout
  br = branch
  ci = commit
  cim = commit -m
  st = status
  sti = status --ignored
  fp = fetch --all --prune
  ai = add --interactive
  cp = cherry-pick
  hist = log --pretty=format:'%Cred%h %Creset%ad %Cgreen(%ar) %Cred|%Creset%s%Cgreen%d %Creset[%Cblue%an%Creset]' --graph --date=short
  type = cat-file -t
  dump = cat-file -p
  staged = diff --cached
  unstage = reset HEAD --
  undo = reset HEAD~
  last = log -1 HEAD
  new-push = !git push -u origin $(git rev-parse --abbrev-ref HEAD)

Enter fullscreen mode Exit fullscreen mode

Also, for someone who's apparently into optimising his git-workflow, you should try to make more meaningful commit-messages. Looking over the commit-log of your repo, all I see is "updated". Please for the sake of the people who want to work with you on the same projects read this short article about git commit-messages

Collapse
 
udithaishan profile image
Uditha Ishan

Thank you for your feedback. Next time I follow good practices.