How can I automatically retain aliases when clonin

2019-07-02 03:31发布

I have a bunch of handy aliases set up in the config file for my git repository. I will occasionally clone this repository (e.g. onto my laptop), but the clone does not included any of the aliases I've set up, presumably because the clone does not copy the git config file where the aliases are stored. I would, however, like to have these aliases available when working with the clone without having to set them up again manually. Has anyone found a good solution for this?

标签: git clone alias
2条回答
SAY GOODBYE
2楼-- · 2019-07-02 03:53

The aliases: are they defined as being for you as the user or for a specific repository?

Each repository can have it's own specific .gitconfig (simply the config file) file within the .git directory (or wherever you set $GIT_DIR to).

For more info check out the docs: http://git-scm.com/docs/git-config (specifically the FILES section)

查看更多
三岁会撩人
3楼-- · 2019-07-02 04:06

You can put aliases into your $HOME/.gitconfig file to make them apply to all repositories on a single machine. (Or set of machines sharing home directories). That's certainly where I keep all mine.

查看更多
登录 后发表回答