Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Cyborg)
  • No Skin
Collapse
Brand Logo

CIRCLE WITH A DOT

  1. Home
  2. Uncategorized
  3. TIL you can set a folder with a git repository as a remote

TIL you can set a folder with a git repository as a remote

Scheduled Pinned Locked Moved Uncategorized
5 Posts 2 Posters 0 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • lunya@sk.lunya.petL This user is from outside of this forum
    lunya@sk.lunya.petL This user is from outside of this forum
    lunya@sk.lunya.pet
    wrote last edited by
    #1

    TIL you can set a folder with a git repository as a remote

    sekomi@meowing.menS 1 Reply Last reply
    0
    • lunya@sk.lunya.petL lunya@sk.lunya.pet

      TIL you can set a folder with a git repository as a remote

      sekomi@meowing.menS This user is from outside of this forum
      sekomi@meowing.menS This user is from outside of this forum
      sekomi@meowing.men
      wrote last edited by
      #2

      no way, this works

      cd /path/to/remote
      git init --bare
      cd /path/to/repo
      git remote add origin file:///path/to/remote
      git push origin main
      
      lunya@sk.lunya.petL 1 Reply Last reply
      0
      • sekomi@meowing.menS sekomi@meowing.men

        no way, this works

        cd /path/to/remote
        git init --bare
        cd /path/to/repo
        git remote add origin file:///path/to/remote
        git push origin main
        
        lunya@sk.lunya.petL This user is from outside of this forum
        lunya@sk.lunya.petL This user is from outside of this forum
        lunya@sk.lunya.pet
        wrote last edited by
        #3

        @sekomi

        I merged a few projects into a monorepo this way

        cd monorepo
        git init
        cd ..
        
        cd myproject1
        mkdir myproject1/
        git mv -k * myproject1/
        git mv -k .* myproject1/
        git commit -m "move to subdir, monorepo"
        cd ..
        cd monorepo
        git remote add -f myproject1 ../myproject1
        git merge --allow-unrelated-histories myproject1/main
        boom, monorepo with preserved history

        sekomi@meowing.menS 1 Reply Last reply
        0
        • lunya@sk.lunya.petL lunya@sk.lunya.pet

          @sekomi

          I merged a few projects into a monorepo this way

          cd monorepo
          git init
          cd ..
          
          cd myproject1
          mkdir myproject1/
          git mv -k * myproject1/
          git mv -k .* myproject1/
          git commit -m "move to subdir, monorepo"
          cd ..
          cd monorepo
          git remote add -f myproject1 ../myproject1
          git merge --allow-unrelated-histories myproject1/main
          boom, monorepo with preserved history

          sekomi@meowing.menS This user is from outside of this forum
          sekomi@meowing.menS This user is from outside of this forum
          sekomi@meowing.men
          wrote last edited by
          #4

          wait, you can merge several git repos into one?

          lunya@sk.lunya.petL 1 Reply Last reply
          0
          • sekomi@meowing.menS sekomi@meowing.men

            wait, you can merge several git repos into one?

            lunya@sk.lunya.petL This user is from outside of this forum
            lunya@sk.lunya.petL This user is from outside of this forum
            lunya@sk.lunya.pet
            wrote last edited by
            #5

            @sekomi yeah, just make sure to move them using git mv -k * subdir/ to a subdirectory and commit that, so that there are no conflicts

            1 Reply Last reply
            1
            0
            • R relay@relay.infosec.exchange shared this topic
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups