Fedora Linux Support Community & Resources Center
Old 31st January 2012, 03:46 PM
sea Offline
"Shells" (of a sub world)
Join Date: May 2011
Location: Confoederatio Helvetica (Swissh)
Age: 37
Posts: 4,277
Using GIT to update scripts at enduser?


Been playing a little with GIT, but since i only use it for a single-person-project, i'm far away of beeing used to it, as there are not many 'issues' showing up.

Anyway, so far i had figured that:
1) push uploads files
2) pull downloads 'git-history'
3) checkout overwrites/restore files from local git-history

So to achieve an update at the enduser, as long they have git installed, i would do it like (pseudo-code):
for each module;   do
      update module history with pull
      checkout files of module
Do you think this is a propper approach, or is there a better solution i havent thought of yet?

Thank you in advance!

---------- Post added at 03:46 PM ---------- Previous post was at 02:19 PM ----------

As i thought, i'm running into issues due to the lack of experience

Error message:
udpate: core.... 
fatal: Not a git repository (or any parent up to mount parent /usr)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
fatal: Not a git repository (or any parent up to mount parent /usr)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
udpate: lfs....
fatal: Invalid refspec '/usr/.scripts/sc/collection/lfs'
udpate: set....
fatal: Invalid refspec '/usr/.scripts/sc/collection/set'
udpate: sup....
fatal: Invalid refspec '/usr/.scripts/sc/collection/sup'
Code Segment:
updatecollection() { folder=$1
        #testi=$(git --version) || echo "GIT is not installed, please install it and try again." && return 1
        for m in core lfs set sup QUIT ; do
            test "QUIT" = "$m" && break
            case $m in
                core)   echo "udpate: $m.... "
                        cd $folder
                        git init # seems to 'help'
                        git pull git://git.code.sf.net/p/seasc/core/sc-core  $folder  
                        git checkout -f
                *)      echo "udpate: $m...."
                        cd $folder/collection/$m
                        git init # init
                        git pull git://git.code.sf.net/p/seasc/sc-$m/sc-$m $folder/collection/$m 
                        git checkout -f  
updatecollection /path/to/script-collection
Ok, so my script source code is located on a seperate partition...
/dev/sda7 /usr/.scripts           xfs     defaults        1 2
How is that influencing the git repo, as the scripts and its module all reside in a subfolder of the script partition?

Heck, i even start the script from inside that partition

* An easy to read introduction of GIT by Eli M. Dow of IBM: http://www.ibm.com/developerworks/linux/library/l-git/
* A very technical explanation of GIT checkout by Linus Torvalds: http://linux.die.net/man/1/git-checkout
These two helped me to pass the first few issues i'd faced.
The 'best' article i've found regarding the cross-partition issue is this: http://stackoverflow.com/questions/7...-and-macfusion.

Ok, using GIT INIT after i changed to the folders, seem to help if the scripts were downloaded as tarball.
However, this brings up a new issue
udpate: core....
fatal: Couldn't find remote ref /home/simon/sc
fatal: You are on a branch yet to be born
udpate: lfs....
fatal: Couldn't find remote ref /home/simon/sc/collection/lfs
fatal: You are on a branch yet to be born
What confused me the most, i dont even use branches...well, only master...

Grr, cant upload code, as i got hit by the 3.2.2-1 wifi bug, and since it didnt happen until now, had deleted the old kernels
EFI Cheatsheet :: http://forums.fedoraforum.org/showthread.php?t=298546
Video Handler Script (VHS) (mass re-encode videos, screenrecorder, console music/webradio player, ...) :: http://forums.fedoraforum.org/showthread.php?t=299182
Windows 8+ & Fedora 20+ Dualboot :: http://forums.fedoraforum.org/showthread.php?t=298161

Last edited by sea; 1st February 2012 at 01:13 AM.
Reply With Quote
Old 3rd February 2012, 01:56 AM
sanhozay Offline
Registered User
Join Date: Jan 2012
Location: Leeds, UK
Posts: 39
Re: Using GIT to update scripts at enduser?

Did you consider just cloning the repository initially and then using pull to drag down updates?

$ git clone <location of your scripts>

// Some time later when the scripts are updated ...

$ git pull
I didn't notice the official Git tutorial in your reading list but it's very accessible and worth a read, especially the section on collaboration. You can view it as a manual page:

$ man gittutorial
Reply With Quote

enduser, git, scripts, update

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
scripts... how to ? Flemming Using Fedora 7 23rd October 2011 07:50 AM
yum and scripts assalane Using Fedora 3 5th March 2009 12:48 PM
How do you run scripts Swaytech Using Fedora 12 20th January 2006 07:03 AM
not able to run scripts spie34 Using Fedora 9 26th August 2004 06:31 PM
Scripts earobinson111 Using Fedora 1 1st August 2004 10:55 PM

Current GMT-time: 01:14 (Friday, 18-08-2017)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat