Heyas
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):
Code:
#PSEUDO-CODE
for each module; do
update module history with pull
checkout files of module
done
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:
Code:
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:
Code:
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
;;
esac
done
}
updatecollection /path/to/script-collection
Ok, so my script source code is located on a seperate partition...
Code:
/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?
EDIT:
Heck, i even start the script from inside that partition
EDIT 2:
* 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.
EDIT 3:
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
Quote:
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
....
....
|
EDIT 4:
What confused me the most, i dont even use branches...well, only master...
EDIT 5:
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