Even though there is not really much to manage, we decided to embrace the
git tool. We should have downloaded the vanilla git rather than GitHub's Desktop GUI tool. Now the command line tools are located in a weird place in the system. We had to add that awkward thing to the
The gist is to just
git verb it.
- Go to our homepage folder and
- Set up what to ignore in
.gitignore. We explicitly added the
git addeverything. Those
gitignored files will not be included.
git commitwith some comments.
- We set up the remote URI with the GUI. Supposedly we should have used
- Then we forcefully
git pushthe stuff to remote. (Next time we can probably just
git pushwithout force.) It failed because we were behind a proxy...
- Set up proxy and push again. (Add entries like
[socks] proxy = socks5://someproxy:port [http] proxy = http://someproxy:port [https] proxy = https://someproxy:port
.gitconfig file in the home directory. Or
git config it. We are no good with proxy. We have no idea which line actually worked.) Then everything went smoothly. It looked easy and nice. The code on our homepage ran and we were reminded of the good old days. Then naturally we cri. 😢
Update: our site is tainted by
git now. 😱
Since we are not pushing to GitHub the
git remote part is different. Normally one
git remote add an ssh scheme. Then one
git push there. However our network does not allow direct ssh connection. There is a special session called
Tuj2 already set up in PuTTY. It contains the info on that weird proxy and the private-public keys. We are supposed to just double click that and get connected. To make
git know what to do when pushing, we need to do the following.
- Point the environment variable
plinkbinary. We have it with PuTTY.
- Tell git to push to remote
Tuj2is the name of the saved session. This is the key trick.
At this point we wondered if we should rename the session name or not and the '2' in the name irks us greatly. (Also before doing all this, set up git on server. Then set up the
post-receive hook which
git checkout the stuff into the web directory from which your web server serves pages.) After the
git push is done, the site is updated automatically.
Side note: didn't dare to git checkout directly to the web directory. We made it
git checkout to a test directory. It did work. Then we changed the checkout directory (given by the
GIT_WORK_TREE variable) in the
post-receive hook to the real thing. We are seriously worried now.
More detailed instruction can be found by Googling.