Move Git From Backup And Sync

1 minute read

Description:

So up until now, I have always been using a folder under my Google Drive for repo’s in Github both personal and work but I have read about these getting out of sync and wanted to get ahead of the curve although everything is currently working (google ‘google drive git corrupt’, example ). Here is what I did:

To Resolve:

  1. On my home computer, which is starting to be my work computer now due to Covid and permanent work from home (yay!), I copied path://google/my-git-repo to c:/git/my-git-repo. I then did:

    • Deleted path://google/my-git-repo
    • Created a batch file with: robocopy C:\git\my-repo Q:\google\my-git-repo /mir /xd .git
    • I then changed my VS Code workspaces to go from old location to new location:

    • Old:
    1
    2
    3
    4
    5
    6
    7
    8
    
    {
       "folders": [
          {
                "path": "Q:\\google\\my-git-repo",
          }
       ],
       "settings": {}
    }
    
    • New:
    1
    2
    3
    4
    5
    6
    7
    8
    
    {
       "folders": [
          {
                "path": "C:\\git\\my-repo",
          }
       ],
       "settings": {}
    }
    
    • Or, lately I have moved all my Powershell repo’s to one workspace so it actually looks like:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    
       {
          "folders": [
             {
                   "path": "C:\\git\\my-repo",
             },
             {
                   "path": "C:\\git\\my-repo-2",
             },
             {
                   "path": "C:\\git\\my-repo-3",
             }
          ],
          "settings": {}
       }
    
  2. After this, I just set that batch file to run daily at midnight so that my git repo’s are still backed up (although really not needed).