API reference¶
Main Class¶
-
class
heroku_git_fs.
HerokuGitFS
(remote_url, directory, branch, keep_history=False)[source]¶ -
__init__
(remote_url, directory, branch, keep_history=False)[source]¶ Initiate a new gitFS folder.
Parameters:
-
remote_url
= None¶ The remote URL of the repository
-
directory
= None¶ The directory used by HerokuGitFS
-
keep_history
= None¶ If this is True, the repository will not be orphaned.
-
branch
= None¶ The branch to use and push to.
-
repo
= None¶ :any:git.Repo object to do operations on.
-
commit
(message='No message given.', username=None, email='dummy@email.com')[source]¶ Create a new commit. If the keep_history attribute is set to False, the branch will be orphaned.
Parameters:
-
push
(remote_url=None)[source]¶ Push the commit to the remote.
Parameters: remote_url (str) – The remote URL to push for. If left empty, the init URL is used Raises: Exception – Pushing the code to the remote failed.
-
update
(message='No message given.', username=None, email='dummy@email.com')[source]¶ Wrapper around commit and push.
Parameters:
-
close
()[source]¶ Nulls the repo and branch attributes and removes the git directory. Also called by __exit__, although you’ll need to set the object to None manually if you call close() yourself.
It should be obvious that after this call, you should no longer use commit() or push() .
Raises: Exception – Any exceptions raised by removing the directory.
-