w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Best way to handle offline and online development with Git

Using a pen-drive could work, but not the way you use it.

What you need is to treat the pen-drive as a remote. So basically you make a bare repository on the pen-drive and push-pull from it. Git will then manage everything.

In short, something like this:

# make repository in pen-drive:
$ cd /path/to/pen/drive
$ mkdir repo; cd repo; git init --bare

And in your repositories (both at home and work):

$ git remote add pendrive /path/to/pen/drive/repo

You can then start pushing to/pulling from pendrive the same way you would do any other remote.

Still, more appropriate would be to ask your company to not block ssh to GitHub (Unless you shouldn't be doing these stuff at work, in which case, well don't do them at work).

© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.