Reputation: 307
My colleague & I are starting on a R project, we both would be working simultaneously & interchangeable components of the model we are building. We can not use Git, as we do not want to put our code online, also it is not allowed by the organization. We also do not have a server of our own, what we have is some common shared drive. Is there a way, we can use a tool like Github/SVN completely locally, where both of us can push our code.
Upvotes: 4
Views: 793
Reputation: 38096
There are two options you can manage your R project with git repo.
You can setup a remote git repo in the shared directory, and then add the remote repo as a remote for your local git repo, then you can push and push from the remote git repo. Detail steps as below:
First, in an empty folder of the shared directory (assume in \\share\path\gitrepo
), execute:
git init --bare
Then add the remote repo as a remote for the local repo you are working. Assume the local git repo (R project) is opened in R Studio, so you can add remote in R Studio terminal window or through git command line:
git remote add origin \\\\share\\path\\gitrepo
Note:
\
in the remote repo url.And the pull and push button is still disabled after adding remote repo since the local branch (maste
) has not tracked the remote branch (origin/master
).
Then you can commit changes and push to remote repo first time by:
git push -u origin master
After that (local master
is tracking origin/master
), the pull and push button will be enabled after refresh the git tool bar. And can pull/push by clicking the buttons afterwards.
If it’s ok for you to hosted your git repo to third-party, and do not let everyone has read permission, then you can create a private git repo in the third-party organization.
For bitbucket, it’s free to create private git repos, so you can host your git repo there.
Upvotes: 3