Convert local SVN to GIT using Tortoise GIT fails with unable connect?

55 Views Asked by At

EDK2 changed from SVN to GIT so I wanted to change my local copy to GIT then try to sync back up with their version so that my working copy changes merge correctly. But when I try I get:

git.exe svn clone "file:///C/edk/edk2" "C:\edk\edk2-git\edk2" -T trunk -b branches -t tags
Can't create session: Unable to connect to a repository at URL 'file:///C/edk/edk2': Unable to open repository 'file:///C/edk/edk2' at C:/Program Files/Git/mingw64/share/perl5/Git/SVN.pm line 310.



git did not exit cleanly (exit code 1) (28781 ms @ 3/24/2024 1:44:47 PM)

Is there something I'm missing? Can this be done?

TIA!!

Update:

svn status:

?       .git
M       BaseTools\Bin\CYGWIN_NT-5.1-i686\Ecc
M       BaseTools\Bin\CYGWIN_NT-5.1-i686\GenDepex
M       BaseTools\Bin\CYGWIN_NT-5.1-i686\GenFds
M       BaseTools\Bin\CYGWIN_NT-5.1-i686\LzmaF86Compress
M       BaseTools\Bin\CYGWIN_NT-5.1-i686\TargetTool
M       BaseTools\Bin\CYGWIN_NT-5.1-i686\Trim
M       BaseTools\Bin\CYGWIN_NT-5.1-i686\armcc_wrapper.py

<snip>

!       StdLib\PosixLib\Stringlist\stringlist.c
!       StdLib\ReadMe.txt
!       StdLib\SocketDxe
!       StdLib\SocketDxe\ComponentName.c
!       StdLib\SocketDxe\DriverBinding.c
!       StdLib\SocketDxe\EntryUnload.c
!       StdLib\SocketDxe\Socket.h
!       StdLib\SocketDxe\SocketDxe.inf
!       StdLib\StdLib.dec
!       StdLib\StdLib.dsc
!       StdLib\StdLib.inc
!       StdLib\UseSocketDxe
!       StdLib\UseSocketDxe\UseSocketDxe.c
!       StdLib\UseSocketDxe\UseSocketDxe.inf
?       patches

Performing status on external item at 'BaseTools\Bin\Win32':

--

ls -l:

Volume in drive C is Windows 10

 Directory of C:\edk\edk2

03/27/2024  02:41 PM    <DIR>          .
03/27/2024  02:41 PM    <DIR>          ..
04/26/2018  01:43 PM                26 .gitignore
05/24/2020  07:39 PM               143 .gitmodules
05/24/2020  07:39 PM    <DIR>          ArmPkg
05/24/2020  07:39 PM    <DIR>          ArmPlatformPkg
05/24/2020  07:38 PM    <DIR>          ArmVirtPkg
05/25/2020  09:20 AM    <DIR>          BaseTools
05/24/2020  10:02 PM    <DIR>          BaseTools_bak
05/25/2020  06:53 PM    <DIR>          Conf
05/24/2020  07:38 PM    <DIR>          CryptoPkg
10/06/2017  02:04 PM    <DIR>          Documents
05/24/2020  07:39 PM    <DIR>          DynamicTablesPkg
05/24/2020  07:38 PM             4,505 edksetup.bat
05/24/2020  07:39 PM             5,316 edksetup.sh
11/29/2018  07:42 PM    <DIR>          EdkShellBinPkg
05/24/2020  07:39 PM    <DIR>          EmbeddedPkg
05/24/2020  07:39 PM    <DIR>          EmulatorPkg
05/24/2020  07:39 PM    <DIR>          FatPkg
05/24/2020  07:39 PM    <DIR>          FmpDevicePkg
05/24/2020  07:39 PM    <DIR>          IntelFrameworkModulePkg
05/24/2020  07:39 PM    <DIR>          IntelFrameworkPkg
05/24/2020  07:39 PM    <DIR>          IntelFsp2Pkg
05/24/2020  07:39 PM    <DIR>          IntelFsp2WrapperPkg
05/24/2020  07:39 PM            28,674 License-History.txt
05/24/2020  07:39 PM             2,732 License.txt
05/24/2020  07:38 PM             8,701 Maintainers.txt
05/24/2020  07:38 PM    <DIR>          MdeModulePkg
05/24/2020  07:51 PM    <DIR>          MdePkg
05/24/2020  07:39 PM    <DIR>          NetworkPkg
05/24/2020  07:38 PM    <DIR>          OvmfPkg
02/04/2013  11:31 PM    <DIR>          patches
05/24/2020  07:38 PM    <DIR>          PcAtChipsetPkg
05/24/2020  07:39 PM             7,219 Readme.md
05/24/2020  07:38 PM    <DIR>          SecurityPkg
05/24/2020  07:39 PM    <DIR>          ShellPkg
05/24/2020  07:39 PM    <DIR>          SignedCapsulePkg
05/24/2020  07:39 PM    <DIR>          SourceLevelDebugPkg
05/24/2020  07:39 PM    <DIR>          StandaloneMmPkg
05/24/2020  07:38 PM    <DIR>          UefiCpuPkg
05/24/2020  07:38 PM    <DIR>          UefiPayloadPkg

--

svn ls

.gitignore
.gitmodules
ArmPkg/
ArmPlatformPkg/
ArmVirtPkg/
BaseTools/
Conf/
CryptoPkg/
DynamicTablesPkg/
EmbeddedPkg/
EmulatorPkg/
FatPkg/
FmpDevicePkg/
IntelFrameworkModulePkg/
IntelFrameworkPkg/
IntelFsp2Pkg/
IntelFsp2WrapperPkg/
License-History.txt
License.txt
Maintainers.txt
MdeModulePkg/
MdePkg/
NetworkPkg/
OvmfPkg/
PcAtChipsetPkg/
Readme.md
SecurityPkg/
ShellPkg/
SignedCapsulePkg/
SourceLevelDebugPkg/
StandaloneMmPkg/
UefiCpuPkg/
UefiPayloadPkg/
edksetup.bat
edksetup.sh

--

git status

On branch master
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
    deleted:    .gitignore
    deleted:    .gitmodules
    deleted:    ArmPkg/ArmPkg.dec
    deleted:    ArmPkg/ArmPkg.dsc
    deleted:    ArmPkg/Drivers/ArmCrashDumpDxe/ArmCrashDumpDxe.c
    deleted:    ArmPkg/Drivers/ArmCrashDumpDxe/ArmCrashDumpDxe.dsc

    <snip>  
    
    deleted:    UefiPayloadPkg/UefiPayloadPkgIa32.dsc
    deleted:    UefiPayloadPkg/UefiPayloadPkgIa32X64.dsc
    deleted:    edksetup.bat
    deleted:    edksetup.sh

Untracked files:
  (use "git add <file>..." to include in what will be committed)
    .gitignore
    .gitmodules
    .svn/
    ArmPkg/
    ArmPlatformPkg/
    ArmVirtPkg/
    BaseTools/
    BaseTools_bak/
    CryptoPkg/
    Documents/
    DynamicTablesPkg/
    EdkShellBinPkg/
    EmbeddedPkg/
    EmulatorPkg/
    FatPkg/
    FmpDevicePkg/
    IntelFrameworkModulePkg/
    IntelFrameworkPkg/
    IntelFsp2Pkg/
    IntelFsp2WrapperPkg/
    License-History.txt
    License.txt
    Maintainers.txt
    MdeModulePkg/
    MdePkg/
    NetworkPkg/
    OvmfPkg/
    PcAtChipsetPkg/
    Readme.md
    SecurityPkg/
    ShellPkg/
    SignedCapsulePkg/
    SourceLevelDebugPkg/
    StandaloneMmPkg/
    UefiCpuPkg/
    UefiPayloadPkg/
    edksetup.bat
    edksetup.sh
    patches/

--

git ls-tree HEAD

100644 blob 97f22c348c10c54174368e361cfa542faa462b05    .gitignore
100644 blob 508f0c182872a5cac17851664724ec0abed00251    .gitmodules
040000 tree ffbf6b76c5a54a8111edb5114c401fba9bcf6fc4    ArmPkg
040000 tree 3f7a1b415cd45f930dd0bb457c8c8ed625e5b28a    ArmPlatformPkg
040000 tree 9927d05cd5cf318471c77a70a0cadc1dc88c5123    ArmVirtPkg
040000 tree c937892d5e1aac2bc5b364182fef42bf78db5b08    BaseTools
040000 tree b50be19dad10d2d665b9c01282b4ce874291266a    Conf
040000 tree 5b5882ab61d027612f31f3d8645bd75737bc2ce0    CryptoPkg
040000 tree 2a77e54b16e3e6abc2e15963bb32cdab3179ea7f    DynamicTablesPkg
040000 tree 89a4fe71128f6d9028d136cc6b2773a792653a4e    EmbeddedPkg
040000 tree e3f890ec5ef18b94c042fff3d4ad2309feed5776    EmulatorPkg
040000 tree df50f94d72570105d2d72ac856c462e2788e3207    FatPkg
040000 tree b2073a7445f471f3c2b714fe80a0c11296af6795    FmpDevicePkg
040000 tree cf9c5b0d59eff336a378928aea4e645ed0e05f9a    IntelFrameworkModulePkg
040000 tree 97e7a5a3a47219eea8338eb77171a57db81a0746    IntelFrameworkPkg
040000 tree 09c1b156b518be117dcf5cc0e19a55787e9f23d1    IntelFsp2Pkg
040000 tree 604a777c115eb1abe26068a533ba09c151338c19    IntelFsp2WrapperPkg
100644 blob 8ab3f67b535b72236c5bb3fdc58ac8a23259e3dc    License-History.txt
100644 blob ee840505cb0c041145ee87fa07be69a51fa325b2    License.txt
100644 blob e52f044bec638e9768345cb1825331474cdebb93    Maintainers.txt
040000 tree 5635c084a3f3f681696060b9ac3fd1862123d25a    MdeModulePkg
040000 tree 2c079834c83ff697473869e1f637b442902029ff    MdePkg
040000 tree f097451c1f8d92268a8212e46f442fb34d7cc2cc    NetworkPkg
040000 tree d7d687127399a473a4889d2590e843a1f3a669ce    OvmfPkg
040000 tree 675bdebcac1a5b003558da4b44b6a93eb8560f0a    PcAtChipsetPkg
100644 blob e564c6c09b83649e1f3ab66bf0fb220fd5022a97    Readme.md
040000 tree 6bdd67b4fed257fbdcda30313142b46608c010bd    SecurityPkg
040000 tree 35d2509c15afaa88b3f62f205ca628bcfe30e909    ShellPkg
040000 tree bef7ceae5ec31952c494679faa175573715acc84    SignedCapsulePkg
040000 tree e7f4c50e08cce97831c8737bba7bd649d88f6432    SourceLevelDebugPkg
040000 tree 55984eff31d7d26436d5b1c6b87dc79f4eb42f80    StandaloneMmPkg
040000 tree 9d8b569a688961d661f3bfe33ea4ef9160057c29    UefiCpuPkg
040000 tree 6968fecf8fd0e5e1fcbf466b5d22aa4d42208c79    UefiPayloadPkg
100755 blob 5f6028deffb7cf211ed84dd7330331d73d40ef87    edksetup.bat
100755 blob c7b2e1e2010aa46af1332c85281df9d0ca9bf68f    edksetup.sh
1

There are 1 best solutions below

21
eftshift0 On

Having the details from the comments, then what you should do is this:

  • Make a backup of the project as you have it (the recipe won't fail, but just in case).
  • Check with svn info (if I recall correctly) the revision number that you are on.
  • run a git init . on the root of the project that you are locally handling with svn. If you run git status at this point, it will tell you that everything is untracked.
  • add a remote in this local repo that points to the git clone that EDK2 has setup. Something line git remote add origin the-utl-to-the-git-repo. I am saying origin because I think it makes sense, but it could be ex-svn or something like that... your choice.
  • run a fetch against this repo so that you get all the information about what is in the remote repo (git fetch origin). Nothing to worry about... it won't mess up your project, it won't touch your local files.
  • Now, in the remote branches (check what is the right branch to look at), identify the git commit that matches the svn revision that you were working on. Tip: you can do searches with git log --grep=<some-patter> so you could do something like: git log --all --grep="the-svn-revision-number" and something should come out of that (and it works because git-svn, at least, leave a comment with the svn revision id and path of the branch/tag when it creates the git commits).
  • Once you have identified the commit, just do a git reset --soft to that git commit id (git reset --soft <the-commit-id>. Now, git should think that it was working on top of that commit.... Run a git add . to get all of the files in the index and it will show you only the pending changes to be committed if you run git status.
  • I would advice to rename the branch so that you do not mix it up with master or main which are probably being used in the remote git repo. This is not mandatory, by the way... git could not care less about the name of the branches but at this stage, it's better that you do not mix it up for your own convenience... at least until you have digested all of these amazing concepts about references which will probably take a while.

You are ready to go.

Let me know how it goes.