Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What characters can I use in a Git alias?

Tags:

git

alias

What characters can I use in a Git alias? For example can "my.branch" or "@mine" be aliases?

Is there a way to make the aliases case sensitive? ex: myBranch

The alias documentaion does not list acceptable characters or anything about case sensitivity.

like image 312
Mike Rylander Avatar asked May 29 '13 18:05

Mike Rylander


People also ask

What are aliases in git?

Git aliases are a powerful workflow tool that create shortcuts to frequently used Git commands. Using Git aliases will make you a faster and more efficient developer. Aliases can be used to wrap a sequence of Git commands into new faux Git command.

What is alias name in github?

Alias is a term associated with shortcuts in Git. It compresses the longer sequence of commands to a shorter sequence. It is always better to apply aliases to the frequently used longer commands since it helps in increasing efficiency.

How can add a git URL as an alias?

The simplest way to add a git alias is by running a command to add the alias to the git global configuration file. For example, running the command git config --global alias. hist "log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short" will add the alias git hist .

How do I use alias in git bash?

To create an alias in Git bash, we need to use the “git config” command followed by the “—global” option, an alias to be created, and an original git command in a single instruction.

Where do I put git alias?

Your git aliases are often stored per your user's configuration at ~/. gitconfig . You can also manually set aliases using, for example, the command git config alias. s 'status -s' .


1 Answers

man git-config says:

The variable names are case-insensitive, allow only alphanumeric characters and -, and must start with an alphabetic character.

For those who want to use a dot (.) as part of the variable name, the same man page also says:

The variables are divided into sections, wherein the fully qualified variable name of the variable itself is the last dot-separated segment and the section name is everything before the last dot.

This should make it clear why those people (including me) are out of hope.

like image 142
Cyker Avatar answered Oct 21 '22 21:10

Cyker