Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This is an experimental feature.  It is possible to lose your work when using git and this is only recommended for advanced users. You can get into a LOT of trouble if you are working with multiple developers simultaneously. If you are working by yourself this is reasonably safe. Before you try the following it is highly recommended that you understand the basics of git.

One important thing to note is that if you're going to use Git, you should be prepared to only use Git.  Do not use WebDAV to edit the files stored on the server in your repo; this will badly break the consistency of your instances.  It is advisable to create a playground instance first to get a handle on Git and how to use it, if you are not familiar with using it as a resource for a production environment.

When git support is enabled a git repository will be created with each instance. When you push updates to the "master" branch of the repository these updates will automatically appear under htdocs/git/[instance name]. The safest way to use this feature is to only push updates from your workstation. It is possible to make changes locally on the server and commit the changes via phpshell but this is dangerous (only recommended for "development" repositories). You also want to be really wary of adding/modifying files that are under the "git" directory in "htdocs" unless you know what you're doing. Think of the "git" directory under htdocs as "read-only" and you'll be safe (it's possible to mingle non-git content, but you better understand what you're doing!).

...

From your splashpage URL find the git URL and clone to your workstation.

No Format

[emc256@emc256 tmp]$ git clone https://webhostXXX.kproxy.cornell.edu/git/cornelldev.git
Cloning into 'cornelldev'...
Username for 'https://webhostXXX.kproxy.cornell.edu': netid
Password for 'https://netid@webhostXXX.kproxy.cornell.edu':
warning: You appear to have cloned an empty repository.

...

The following creates a file "index.html" that contains "hello from git"

No Format

[cornelldev]$ echo "hello from git" > index.html

Add the file into your local git repo

No Format

[cornelldev]$ git add index.html

Add a description of your new file

No Format

[cornelldev]$ git commit -m 'added index.html'
[master (root-commit) 979fa78] added index.html
 Committer: Firstname Lastname <netid@cornell.edu>
 1 file changed, 1 insertion(+)
 create mode 100644 index.html

...

The following will push the content up to the server and publish it add https://webhostXXX.hosting.cornell.edu:XXXX/git/cornelldev (assuming the instance is named cornelldev)

No Format

[emc256@emc256 git]$ git push origin master
Username for 'https://webhostXXX.kproxy.cornell.edu': netid
Password for 'https://netid@webhostXXX.kproxy.cornell.edu':
Counting objects: 3, done.
Writing objects: 100% (3/3), 234 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: From /www/repos/git/cornelldev
remote:  * [new branch]      master     -> origin/master
To https://webhostXXXX.kproxy.cornell.edu/git/cornelldev.git
 * [new branch]      master -> master