Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Git aliasing truncates command definition

I have been trying to alias the following command for removing tracked files from the repository:

> git config --system alias.untrack 'rm --cached'

However when I check the configuration, the alias definition is truncated and throws when used:

> git config --list
alias.untrack='rm
> git untrack
fatal: bad alias.untrack string: unclosed quote

How to avoid the above behaviour?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

I guess you ran the command in Windows CMD. If so, use double quotes instead of single quotes.

git config --system alias.untrack "rm --cached"

On Windows, git bash is recommended over CMD or PowerShell. With the latter 2, you have to deal with some annoying special characters.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading