search

Home  >  Q&A  >  body text

Set parameters in .gitconfig [alias] pre = !cd a certain directory; then it can run but will not jump to the directory. Solve

Because I want to operate git quickly; so I want to use aliases to solve the problem. The result cannot be achieved:

Then use the git pre command

It will not jump to the specified directory

Others such as ls -a; git pull, etc. have no problem setting aliases
Only the cd command does not work...

習慣沉默習慣沉默2843 days ago687

reply all(1)I'll reply

  • PHP中文网

    PHP中文网2017-05-02 09:46:27

    git alias is its own process, cd in the child process will not affect the parent process (your shell)

    You can write a shell function or shell alias

    reply
    0
  • Cancelreply