User:Cristinac/UsingGIT
From XPUB & Lens-Based wiki
< User:Cristinac(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Wiki in a folder
network Collaboration
Git
can use email or peer to peer
Static files are great, but MySql and PHP will slow down the server
git basic commands:
git init
git status
ls -a (access all content including hidden files)
ls .git
git add git.mediawiki
git commit -m “message_goes_here”
:q =to quit something, especially when committing
to initialize git: git init
to change commitments in the past: git commit --amend --reset-author -m "this is a wikipedia entry”
you can also use “diff"
commit ceaf8d629e2babe38dc75d2a0f0ac42fe36545e1 =the cryptographic hashes that you commit
Hosting identity:
-ssh (secure shell protocol)
Git identity:
-add
-commit
-pull
-push
to become a server:
-sudo aptitude install openssh-server
-sudo add user git
-sudo ifconfig
to share a repo in git:
-create “bare” copy
-copy it to the server
-clone it from server
-back up one level (you are back on your own user)
-write:
-git clone --bare wiki wiki.git
-scp -r wiki.git git@145.24.143.42:
where “-r” is used to copy folders
scp is “secure copy”
to make a text file:
-touch file.txt
to pull from git:
-git clone git@145.24.143.42:wiki.git
PART II
ssh git@pzwart1.wdka.hro.nl
password: wikiinafolder
installing a repo:
-you need a “bare” repo: git clone —bare wiki wiki.git
-copy to the server: scp -r wiki.git git@pzwart1:git
-clone from the server: git clone git@pzwart1:git/wiki.git
content based approach to managing files
to redirect to the current folder:
-first check which one the origin is:
cd wiki
git status
git remote -v
(for help: git remote —help)
-change origin to current server address:
git remote set-url origin git@pzwart1.wdka.hro.nl:git/wiki.git
-now check:
git remote -v
if we are on the same subnet, static or dynamic, we can see each other
IP addresses:
there is a subnet mask (last 2 digits of the IP number)
Gateway:
a router that connects different networks together by having a protocol to connect different routings together
DNS:
DHTP:
wget --random-wait -r -p -e robots=off -U mozilla http://conceptlab.com/criticalmaking/
brew install ssh-copy-id
source->html->web server
interface to see history: OSP, source tree, gollum
pandoc --from mediawiki --to html git.mediawiki
pandoc --to markdown aabcdde.docx -o abcde.md
pandoc --from markdown --to html abode.md --standalone -o abcde.html
git untracked.
for debian to use pandoc install:
haskell-platform
Wiki in a folder part II
when using makefiles: don’t use spaces, use indentation:
--command \
--command \
make is installed already in the system
write all recipes in the makefile
you will find all files in cristinacochior>gitparttwo
ls -hl
tells you the timestamp of when it was edited
touch notebook.md
changes the timestamp
make
will take only the first rule
web publishing workflow:
hooks are shell scripts that update themselves when something is pushed to
you can only push to a bare repository
we push to the prime/origin, you have a hook that makes it move into it when you pull
this must be done while you are in the server
hub=bare repository
prime=public server=origin
combining repositories:
go into the bare repository (doesn’t have anything but the hooks in it), go into hooks folder
exec git update-server-info
cd /home/git/
emacs is the server editor. to exit use: control+x+c (not simultaneously)
chmod +x script
To create a repo on the server, ssh into the server first, then:
*cristina@pzivm01:~$ mkdir test_repo.git
*cristina@pzivm01:~$ cd test_repo.git/
*cristina@pzivm01:~/test_repo.git$ git --bare init
then, from your local user, in the folder that you want to save it in:
*git clone cristina@pietzwart1.wdka.hro.nl:git/repo.git
*from there you can add, commit, status, push
then return to user and cd into the public folder:
*git clone ~/git/repo.git/
then exit, go into git repo, more specifically in the hooks folder:
*cp post-update.info post-update
*nano post-update
*in the file, erase all that is in it and replace with:
#!/bin/sh
#
# An example hook script to prepare a packed repository for use over # dumb transports.
#
# To enable this hook, rename this file to "post-update”.
# exec git update-server-info
echo
echo "**** Pulling changes into Prime [Hub's post-update hook]" echo cd $HOME/public_html/repo || exit unset GIT_DIR
git pull origin master
exec git-update-server-info
*to test: ./post-update
http://pzwart1.wdka.hro.nl/~cristina/repo/
Wiki API