简体   繁体   中英

Git rename top-level project folder without messing up downstream

I have a repository which resides in C:\\dev\\jenkins-1.501 . I want to move it to C:\\dev\\jenkins-rpci but not mess up anyone downstream of this repo. Ideally, repos who have this repo as a remote should not see any changes to the files when they fetch . The mv method does not work.

j@WI1DEV /c/dev/jenkins-1.501 (rename)
$ cd ..
j@WI1DEV /c/dev
$ git mv jenkins-1.501/ jenkins-rpci
fatal: Not a git repository (or any of the parent directories): .git

Edit: There is only one repo downstream of this right now. It has local modifications. If the solution requires setting a new remote, that is OK, but hopefully there is a way to do it without creating tree conflicts or something like that.

git mv is to move files within a repo.

you could symlink from the new repo location to the old location, but apart from that i don't see how you can solve it without updating the remote for the downstream repos.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM