Last active
November 17, 2023 19:20
-
-
Save LucasLevino/38efa583fd322b0790df1a9d82d4300b to your computer and use it in GitHub Desktop.
Comando de personalização do git
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commands in shell | |
git config --global core.editor code | |
git config --global --edit | |
add in .gitconfig | |
[alias] | |
c = !git add --all && git commit -m | |
nb = !git checkout -b | |
p = !git push -u origin | |
s = !git status -s | |
[MacOS] l = !git log --pretty=format:'%C(blue)%h%C(red)%d - %C(white)%s - %C(red)%cn, %C(green)%cr' | |
[Windows] l = !git log --pretty=format:'%C(blue)%h%C(red)%d - %C(white)%s - %C(blue)%cn, %C(green)%cr' | |
t = tag -a $1 -m $1 | |
graph = !git log --graph | |
search = !git log --grep= | |
amend = !git add --all && git commit --amend --no-edit | |
count = !git shortlog -s --grep | |
[push] | |
followTags = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
in shell | |
#$ git c "your commit here" | |
# | |
#$ git nb feature_branch_name | |
# | |
#$ git p feature_branch_name |
Also I am curious what sh -t is for?
I have an alias which takes an argument and uses it. See $1. If that's what you're after then you can start with tag and not sh
clone-s = "! [ $# -ne 1 ] && echo 'Args: REPO' || git clone git@github.com:MichaelCurrin/$1.git"
e.g.
git clone-s os-genesis
It also gives me an error message if I leave off the arg
sorry, is sh -c
this a command for create a tag to git repository
Ok thanks.
The !
already invokes the shell so you don't need to add sh too.
And you are doing plain git command so can leave off !
.
So you can do
t = tag -a $1 -m $1
thanks, i'll change it
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm looking at public gists and found yours.
Thanks for sharing
BTW you can simply things like this as it will work the same
The first
c
one uses shell &&, so you'll have to keep that as is.I don't know if the quotes are always needed but based on my linter I put them in. Note that single quotes on the outside will actually break the command when you run it so use double quotes.