Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I've set up a git origin repository called project_name/.git.</p> <pre><code> ssh to the server, (entering ssh passwords or passphrases as I go) mkdir project_name cd project_name git init touch fabfile.py git add fabfile.py git commit -a -m "almost empty" git checkout -b web </code></pre> <p>I leave branch web checked out. Back to the local machine.</p> <p>I pull from the server via clone and added my project dir contents in branch master on the local repo. Stll not using fabric, just setting things up, although these steps could be automated too, I suppose, and none of them need another ssh passphrase.</p> <pre><code> cd /path/to/project_name/.. git clone ssh://joe@some_server.com/var/web/project_name/.git cd project_name gvim fabfile.py git add fabfile.py git commit -a -m "fabfile edits" </code></pre> <p>Now I start using fabric. Below is excerpted from my fabfile for managing git tags and branches:</p> <pre><code> #Usage: fab committag brpush | fab committag push | fab push | fab tag def committag(): """commit chgs, tag new commit, push tags to server.""" prompt('commit descr: ', 'COM_MSG', default='new stuff') prompt('commit name: ', 'COM_NAME', default='0.0.1') local('git commit -a -m "%(COM_MSG)s"' % env) local('sleep 1') local('git tag -u "John Griessen" -m "%(COM_MSG)s" %(COM_NAME)s' % env) local('sleep 1') local('git push origin --tags') #pushes local tags def brpush(): """create a new branch, default COM_NAME, then push to server.""" prompt('new branch name: ', 'BR_NAME', default= '%(COM_NAME)s' % env) local('git checkout -b %(BR_NAME)s' % env) local('sleep 2') local('git checkout master') local('git push origin --tags') #pushes local tags local('git push --all origin') #pushes local master and branches def push(): """Push existing tags and changes to server.""" local('git push origin --tags') #pushes local tags local('git push --all origin') #pushes local master and branches def tag(): #Call this from committag() """create a gpg signed tag on the local git repo tag from prompted name .""" prompt('tag descr: ', 'TAG_MSG', default='0.0.1') prompt('tag name: ', 'TAG_NAME', default='0.0.1') local('git tag -u "John Griessen" -m "%(TAG_MSG)s" %(TAG_NAME)s' % env) </code></pre> <p>To use the above fabfile defs, I just make some changes to my project dir, think of an apporpriate message about them, and do:</p> <pre><code>$fab committag </code></pre> <p>and I have changes tagged and updated on the server. Or:</p> <pre><code>$fab committag brpush </code></pre> <p>and I have a new branch created and the server updated.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload