简体   繁体   中英

Copy a project from Windows to Ubuntu in a way that git is recognized

I have copied a project (which was initialized with git and so contains a.git folder) from Windows to Ubuntu . If I now open the project on Ubuntu, VSCode tells me:

The folder currently open doesn't have a git repository

If I run git status , I get the following output:

fatal: cannot chdir to 'C:/Users/.../my_project': No such file or directory

What is the right way to copy the project with a relative path, so that it can be recognized by other systems?

It is possible to package files and their history in a new local .git file:

git bundle create MyProject.git HEAD

Then you can copy/send the file from a Windows machine to Linux machine and clone it over there:

git clone MyProject.git /path/to/clone

And then eg add the origin remote:

git remote add origin https://dev.azure.com/path/to/_git/projectname

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