Geeks With Blogs

News This is the *old* blog. The new one is at blog.sixeyed.com
Elton Stoneman
This is the *old* blog. The new one is at blog.sixeyed.com

More of a note-to-self,  but may be useful to other ReadyNAS users who aren’t quite at home with Linux.

As I’m doing a lot of coding with different environments, and I want easy SCM, git is a fine choice. Git runs through IP addresses, so I can access remote servers inside VMs without any weird config needed. It integrates natively with XCode for iOS programming, and msysgit  is a simple UI for Windows (there is also a VS extension for git).

Setting up git on the ReadyNAS is straightforward, but there are a couple of fiddly steps. First of all install the git add-on and get it configured correctly:

  1. Install the  latest version of the community git add-on (download the .bin file and upload as a local update through FrontView, as with any other packages).
  2. Enable root SSH access with the ReadyNAS add-on
  3. Sign on to SSH as root: ssh root@your_nas_ip  (using your FrontView admin password)
  4. Open the remote logon script for SSH -  text editor vi will get you there: vi .bashrc
  5. Insert a new line in the script to add the folder with the git binaries to the path for remote logins: export PATH=PATH:/opt/rfw/bin

To create & populate your remote repository:

  1. Sign on to SSH as root: ssh root@your_nas_ip
  2. Create the folder for your repository:  mkdir /opt/git/what_ever && cd /opt/git/what_ever
  3. Initialise the repository: git – bare init
  4. Exit SSH (exit)
  5. Navigate to the local git project folder: cd projects/etc
  6. Add the remote repo: git remote add origin ssh://root@your_nas_ip/opt/git/what_ever
  7. Populate the remote repository: git push origin master (using your admin password).

All done, and you can push, pull and clone to your NAS drive as if it were github. Navigate to local Web interface (https://your_nas_ip/gitweb/gitweb.cgi) and you should see your new project listed, and you can browse all the previous commits.

 

 

Posted on Thursday, June 9, 2011 10:29 PM | Back to top


Comments on this post: Setting up a remote git repository on your ReadyNAS

# re: Setting up a remote git repository on your ReadyNAS
Requesting Gravatar...
Very Informative article, its cool how this camera's work, keep posting articles like this, thank you
Left by Londen on Sep 07, 2011 12:51 PM

# re: Setting up a remote git repository on your ReadyNAS
Requesting Gravatar...
This is such a great resource that you are providing and you give it away for free. I love seeing websites that understand the value of providing a quality resource for free. It’s the old what goes around comes around routine.
Londen
Left by Londen on Sep 07, 2011 12:55 PM

# re: Setting up a remote git repository on your ReadyNAS
Requesting Gravatar...
I found some really interesting stuff in your post especially this discussion. Keep up the good work. y8
Left by y8 on Nov 18, 2011 2:28 PM

# re: Setting up a remote git repository on your ReadyNAS
Requesting Gravatar...
Hey! Nice article!
Am trying to setup git on my readynas but I'm coming up short with a fatal: Not a git repository. Did you encounter this error?

Best Regards
Johan Nilsson
Left by Johan Nilsson on Dec 13, 2011 11:47 PM

# beats pro
Requesting Gravatar...
Over the past 10 years observing the total eclipse the best curtain call after 11, 14, the year's most worthy of the Gemini meteor shower observing the beats Solo hd night sky is about to bloom, the interested public choice vision, the Department did not affect the observed light.


Astronomy education experts Zhao Heng said, as the northern hemisphere three major meteor shower, one of the Geminid meteor shower (the other two are Perseids and Quadrantids meteor shower), has always been to traffic flow and stability is known, is the year's most worthy of observation of the meteor shower. It only appeared beats pro in the 19th century, and the flow of small beginning, in the 10 -20 pieces per hour. Since then, it began to increase the flow of current flow has become an annual one of the larger meteor shower. Under ideal sky conditions, the theoretical zenith hourly number of meteors in the 120 or so.
Left by beats Solo hd on Dec 20, 2011 9:25 AM

# re: Setting up a remote git repository on your ReadyNAS
Requesting Gravatar...
@Johan I did see the same error "Not a git repository". But it turned out to be just a path typo on my part ("git remote add origin <etc, etc>").

Also, be sure to add a '$' char to the PATH in your .bashrc...
"export PATH=$PATH:/opt/rfw/bin", or things will get rather wonky.

Anyway, things seem to work just fine on my Nas Ultra 4.

Very grateful for having this!!!
~P
Left by Paul on Feb 05, 2012 4:16 AM

# nasduo -export PATH=$PATH:/opt/rfw/bin
Requesting Gravatar...
Thanks for the post. Got me set up in no time at all.

Just to confirm on my Nasduo no $ was requiried.

Left by Jon on Jul 13, 2012 9:58 PM

# re: Setting up a remote git repository on your ReadyNAS
Requesting Gravatar...
Hmm, just screwed it on my ReadyNAS NVX by using "export PATH=PATH:/opt/rfw/bin" instead of "export PATH=$PATH:/opt/rfw/bin".

Now, my path is screwed and I can just run the git commands. but ls, cp or vi give me this:
-bash: ls: command not found

What can I do?
I found a tip on http://superuser.com/questions/191022/how-to-fix-a-bashrc-thats-been-edited-wrongly
to do cp /etc/skel/.bashrc ~

But cp command cannot be found.

Anyone an idea?
Left by Jeroen on Sep 15, 2012 1:03 PM

# re: Setting up a remote git repository on your ReadyNAS
Requesting Gravatar...
Here I have found the information for which I was looking for long time.
Left by Velicanstveni je sulejman on Oct 21, 2012 3:26 PM

# re: Setting up a remote git repository on your ReadyNAS
Requesting Gravatar...
If you screwed up the Path because of the careless initial instructions forgetting the $ in front of PATH, run /bin/vi /root/.bashrc and fix it. Also it takes two -- in front of 'bare'.
Left by Barack Obama on Nov 07, 2012 1:34 PM

# re: Setting up a remote git repository on your ReadyNAS
Requesting Gravatar...
Thanks for the excellent post.

I have just one question regarding the git seup. How do you back up the git repo from the ReadyNAS. as the repository in the above example is in
/opt/git/what_ever

so, unless I've missed something, it's not in a user/group share

can you use the standard backup jobs in the ReadyNAS to automatically take a snapshot of the git repo to backup (i.e back up the repo to external media or using rsync)

Thanks in Advance,

Regards,

Mark
Left by Shoe on Aug 12, 2014 4:23 AM

Your comment:
 (will show your gravatar)


Copyright © Elton Stoneman | Powered by: GeeksWithBlogs.net