Git on Webfaction Cheat Sheet

A Programming › Git cheat sheet in English by DeeJRoth

Usage of Git on Webfaction hosting

7,470 views 2,837 downloads 30 Dec 2014 History
3.7 avg · 0 ratings

Scope of This Cheat Sheet

After following the setup instru­ctions on the Webfaction hosting website, I often forget the rules for naming and creating a new Git repo and cloning that repo. This sheet is meant to be short, and just enough to jog the memory of those who use it.
This cheat sheet assumes you already have a Webfaction hosting account and the knowledge of using its features.

Creating a New Repository

1.
SSH into your Webfaction account
2.
Switch to applic­ati­on's repos sub directory. cd ~/weba­pps­/gi­t/repos
3.
Create the repo. git init --bare {repo}.git {repo} should be the name of the new reposi­tory. The .git extension is required for all reposi­tories!
4.
Switch to the new repo's directory. cd {repo}.git Where {repo} is the name of your newly created repository
5.
Enable HTTP push. While in the newly created repo's directory, run: git config http.r­ece­ivepack true
Quick note on naming new reposi­tories:
A. The .git extension is required on all repository names
B. There can only be one dot (.) in the reposi­tor­y's name, and that should preceed the git extension

Examples:
repo
repo.git
repo.c­om.git

Cloning a Repository

Type
Git Command
Local
git clone /home/­use­rna­me/­web­app­s/a­pp/­rep­os/­pro­j.git
HTTP (Anon)
HTTP (Auth)
SSH
git clone userna­me@­use­rna­me.w­eb­fac­tio­nal.com:/home­/us­ern­ame­/we­bap­ps/­app­/re­pos­/pr­oj.git
NOTE
Links in the above commands do not work
If you plan on adding large file, a mass quantity of files, or making many changes to your repository between pushes and pulls, consider changing the postBuffer setting on your local repositry clone.

1. Switch to the clone of the repo
2. Execute git config http.p­ost­Buffer {{bytes}} where bytes is the maximum number of bytes permitted.

Example: To allow for a push of up to 500 MB, execute git config http.p­ost­Buffer 524288000

Removing a Git Repository

1.
Read the warning note below!!!
2.
SSH into your Webfaction account
3.
Enter your repos sub-di­rectory cd ~/weba­pps­/gi­t/repos
4.
Execute rm -r {{repo}}.git to remove the repository {{repo}}.git
Removing a repository cannot be undone by you or a member of the Webfaction team! If you remove a repo, it is solely on you...r­emove with caution!

Badges

Good Cheat Sheet Nice Cheat Sheet

Comments

No comments yet.

Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.