Skip to content

Instantly share code, notes, and snippets.

@mikaelhadler
Last active February 10, 2023 11:32
Show Gist options
  • Save mikaelhadler/7df03a524690fa2b9004461a741e3a23 to your computer and use it in GitHub Desktop.
Save mikaelhadler/7df03a524690fa2b9004461a741e3a23 to your computer and use it in GitHub Desktop.
Add alias bash and git alias

For your alias to be insert in commands bash, you need to include that in .bashrc, so take this example and to be happy:

echo alias g=\'git\' >> .bashrc

If you have a success with this command, you can now call git with 'g' command.

Now, if you like alias git, you can create your personal alias file, take this example and edit your file ~ / .gitconfig:

[user]
	email = mikaelhadler@gmail.com
	name = Mikael Hadler
[core]
	editor = vim
[alias]
    st = status
    ac = !git add . && git commit
    ck = checkout
    cb = checkout -b
    cm = commit
    p = push origin
    pl = pull origin
    b = branch
    f = fetch origin
    revert = reset --hard HEAD~1
    dd = diff
    del = branch -D
    l = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment