How do I set default aliases or other configuration for my git repository?

前端 未结 2 593
眼角桃花
眼角桃花 2021-01-24 23:02

I\'d like to set some default aliases and other configuration for a git repository, so that when new users clone it they have those aliases immediately available for them in tha

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-24 23:40

    I would discourage trying to impose your preferred interface with git on other users just because they clone a repo you set up. It may just be that you used an over-simplified example, but to be blunt it's none of your business whether a user sets st as an alias for status.

    If you think there's some reason why working with your repo really calls for certain aliases, then you could include a script that sets them up in the root of your project. You could then document this in whatever ways you like - a README file, notes on your project page, etc.

    But for the mere act of cloning to cause aliases to be set up - even local to that new clone - would be a massive security hole, so not only can't it be done, but I would expect this never to change.

提交回复
热议问题