Last active
December 20, 2015 08:19
-
-
Save SamyPesse/6099875 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from gittle import Gittle | |
path = '/tmp/gittle_bare' | |
# Clone repository | |
repo = Gittle.clone('git://github.com/FriendCode/gittle.git', path) | |
# Information | |
print "Branches :" | |
print repo.branches | |
print "Commits :" | |
print repo.commit_count | |
# Create a new file | |
fn = 'test.txt' | |
filename = os.path.join(path, fn) | |
fd = open(filename, 'w+') | |
fd.write('My file commited using Gittle') | |
fd.close() | |
# Stage file | |
repo.stage(fn) | |
# Do commit | |
repo.commit(name='Samy Pessé', email='samypesse@gmail.com', message="This is a commit") | |
# Commit info | |
print "Commit : ", repo.commit_info() | |
# Auth for pushing | |
repo.auth(pkey=open("private_key")) | |
# Push | |
repo.push() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment