0

Here is my situation. I have a computer which cannot connect to the network. I have created a repository of it's code on our remote bitbucket instance (using my laptop). What is the easiest way to implement version control in a situation like this?

This is what I was thinking and have done so far.

  1. The master is on the remote bitbucket instance (point A)
  2. I have cloned master onto an external hard drive (point B)
  3. I have copied the .git folder from the hard drive onto the target machine (point C) at the root directory of the code (just like in the hard drive clone)

What's the best way to go about making commits? Let's say on the target machine I change some code and commit to that local repo. How can I then sync that with the hard drive repo (so that the local machines commits are latest) and then in turn sync that to master on the remote server?

Am I answering my own question in terms of the strategy of this?

  • Git is a distributed version control system, so you can just share between repositories directly. Check out [“Distributed Git - Distributed Workflows”](https://git-scm.com/book/en/v2/Distributed-Git-Distributed-Workflows). – poke Apr 16 '19 at 17:45

2 Answers2

2

You want to use git bundle. Docs and examples below.

https://git-scm.com/docs/git-bundle
https://git-scm.com/book/en/v2/Git-Tools-Bundling

EncryptedWatermelon
  • 4,788
  • 1
  • 12
  • 28
1

I have copied the .git folder...

This is never a good idea. Remember that any folder that contains a .git folder is itself a repository. To copy that repo, you can just do git clone /path/to/folder.

Code-Apprentice
  • 81,660
  • 23
  • 145
  • 268