If one wants to contribute to puppylinux they might do something like this:
Code: Select all
git clone git@github.com:puppylinux-woof-CE/woof-CE.git -b testing "new-branch"
cd "new-branch"
git checkout -b "new-branch"
#Make code changes
git add .
#Set remote to your fork of woof-CE
git remote origin set-url git@some-olther-url.git
git push origin "new-branch"
#Create a merge/pull request
One way that we can clone only part of woof-CE is do a spare checkout. First we setup our local repo:
Code: Select all
#/bin/sh
[ -z "$2" ] && set -- "$1" ppm #ppm is the default second argument
mkdir "$2"
cd "$2"
if [ "$1" = init ] || [ "$1" = all ]; then
git init
git remote add origin git@github.com:puppylinux-woof-CE/woof-CE.git
git remote add –f origin git@github.com:puppylinux-woof-CE/woof-CE.git
git config core.sparsecheckout true
fi
Code: Select all
if [ "$1" = add_checkouts ] || [ "$1" = all ]; then
#Main Directory
echo /woof-code/rootfs-skeleton/usr/local/petget/ >> .git/info/sparse-checkout
#Another important directory
echo /woof-code/rootfs-packages/check_deps_gui >> .git/info/sparse-checkout
...
fi
Code: Select all
echo /woof-code/rootfs-skeleton/usr/local/bin/ppm >> .git/info/sparse-checkout
echo /woof-code/rootfs-skeleton/root/.packages >> .git/info/sparse-checkout
echo /woof-code/rootfs-skeleton/usr/sbin/petget >> .git/info/sparse-checkout
echo /woof-code/rootfs-skeleton/usr/sbin/dotpup1 >> .git/info/sparse-checkout
Code: Select all
echo /woof-code/rootfs-skeleton/usr/bin/dir2pet >> .git/info/sparse-checkout
echo /woof-code/rootfs-skeleton/usr/bin/dirs2pets >> .git/info/sparse-checkout
echo /woof-code/rootfs-skeleton/usr/bin/dotpet >> .git/info/sparse-checkout
echo /woof-code/rootfs-skeleton/usr/bin/pet2tgz >> .git/info/sparse-checkout
echo /woof-code/rootfs-skeleton/usr/bin/petspec >> .git/info/sparse-checkout
echo /woof-code/rootfs-skeleton/usr/bin/tgz2pet >> .git/info/sparse-checkout
echo /woof-code/rootfs-skeleton/usr/sbin/dotpup1 >> .git/info/sparse-checkout
Code: Select all
echo /woof-code/rootfs-skeleton/usr/sbin/dotpup >> .git/info/sparse-checkout
Perhaps some empty directories:
Code: Select all
echo /woof-code/rootfs-skeleton/var/packages >> .git/info/sparse-checkout
the petget.desktop file:
Code: Select all
#This defines the menu item for the package manager.
echo /woof-code/rootfs-skeleton/usr/share/applications/petget.desktop
Code: Select all
echo LICENSE >> .git/info/sparse-checkout
Code: Select all
echo /woof-code/0setup >> .git/info/sparse-checkout
echo /woof-code/PKGS_MANAGEMENT >> .git/info/sparse-checkout
echo /woof-code/_00build.conf >> .git/info/sparse-checkout
echo /woof-distro >> .git/info/sparse-checkout
Anyway, once we have setup our local sparese-clone then cd into the directory and pull from woof-CE:
Code: Select all
cd ppm
git pull origin testing
Complete script
The complete script can be found at:
https://pastebin.com/tr1rX3dM -- clone_ppm
** use raw view to copy form pastebin
I suggest creating a folder called ppm. Open up a terminal in this folder:
Code: Select all
chomod +x ppm
clone_ppm all "branch_name" #This both initiates our git repo and sets up the files for a sparce pull
cd "branch_name"
git pull origin testing
git checkout -b "branch_name"
I created a new repo on github called ppm via the web interface, and then did the following commands to push the code to this repo.
Code: Select all
get remote rename origin origin_old
git remote add origin https://github.com/s243a/ppm.git
git --prune push origin testing
References / links / notes
1 - https://stackoverflow.com/questions/600 ... 1#13738951
2 - http://jasonkarns.com/blog/2011/11/15/s ... -checkout/
3 - http://schacon.github.io/git/git-read-t ... e_checkout