FPGA 101 : How to make use of OneDrive/Google drive as git repository

Introduction

We are going to introduce how to manage our codes flexibly especially you have multiple computers to work on without using Github or Bitbucket.

For example, you have a high performance desktop computer and another one light-weight mobile laptop for your external works. You really want to make use both of them but you are frustrated every time you need to transfer your files and sync up together using USB. You are lazy, You just hate to find your disk from your laptop backpack and plug into your computer, TWICE a day.

With today availability of high speed internet (not really in Malaysia, but it’s fine if you are using 1mbps internet), let’s utilize your free space from your email providers (Microsoft or Google) and make them sync all the files you need after you made the changes.

Steps

Step 1:

Install Git for Windows https://git-scm.com/download/win or use Cygwin, a bash shell for Windows platform.

Step 2:

Create an empty folder for your project.

Step 3:

Enter to the folder and right-click select “Git Bash Here” (for user using Git for Windows).

Step 4:

A command shell pop up, key in the following command

$ git init

This will initialize a new git in the folder.

Step 5:

Create a file named “git_tutorial.sv”.

For example:

$ echo "module ()" > git_tutorial.sv

Step 6:

git add and git commit newly added file with tag “git_testing”. This will push current changes to local branch.

$ git add git_tutorial.sv
$ git commit -m "git_testing"

Step 7:

Create a git remote area inside OneDrive folder, go to OneDrive folder and initialize a git.

$ git init --bare git_tutorial_project.git

Step 8:

Go back to first bash shell with committed changes, create a remote git called “TestRemote” and point to “git_tutorial_project.git” in OneDrive folder.

$ git remote add TestRemote /cygdrive/c/Repo/OneDrive/OneDrive_Git_Tutorial/git_tutorial_project.git

Step 9:

Push the changes to OneDrive master branch.

$ git push -u TestRemote master

Step 10:

Wait until the OneDrive sync to cloud server, then you can pull or clone the git from other computers.

$ git clone [Pathto]/OneDrive/OneDrive_Git_Tutorial/git_tutorial_project.git project_clone0

Spread the word. Share this post!

Leave a comment

Your email address will not be published. Required fields are marked *