FPGA 101 : How to make use of OneDrive/Google drive as git repositoryPosted on: July 25, 2017, by : admin
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.
Install Git for Windows https://git-scm.com/download/win or use Cygwin, a bash shell for Windows platform.
Create an empty folder for your project.
Enter to the folder and right-click select “Git Bash Here” (for user using Git for Windows).
A command shell pop up, key in the following command
$ git init
This will initialize a new git in the folder.
Create a file named “git_tutorial.sv”.
$ echo "module ()" > git_tutorial.sv
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"
Create a git remote area inside OneDrive folder, go to OneDrive folder and initialize a git.
$ git init --bare git_tutorial_project.git
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
Push the changes to OneDrive master branch.
$ git push -u TestRemote master
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