Python script to download repos from github. It checked localfiles and skips downloading any repos that currently exsist. Perform a git pull for each repo that exsists
In [50]:
from github import Github
In [51]:
import os
import getpass
from git import *
import git
In [52]:
p = open('/home/wcmckee/ps.txt', 'r')
In [53]:
#str(p.read())
In [54]:
pred = str(p.read())
In [55]:
g = Github('wcmckee', 'test')
In [56]:
grepo = g.search_users('wcmckee')
In [57]:
for gre in grepo:
print gre.repos_url
In [58]:
print gre.email
In [59]:
grrep = gre.get_repos()
In [60]:
replist = list(grrep)
In [61]:
repolisx = []
repocom = []
In [62]:
for repoz in replist:
print repoz.name
repolisx.append(repoz.name)
print repoz.size
print repoz.updated_at
# repocom.append(repoz.get_commits)
In [63]:
#for repz in repocom:
# print repoz.ssh_url
In [64]:
for repoit in repolisx:
print repoit
In [65]:
repolisx
Out[65]:
In [69]:
homlaz = ('/home/wcmckee/pygitx')
In [71]:
os.chdir(homlaz)
In [72]:
#opgitp = open('gitp.txt', 'r')
In [73]:
#_LOKDD
In [74]:
#rpa
In [75]:
dirlis = os.listdir(homlaz)
In [76]:
dirme = set(dirlis) - set(repolisx)
In [77]:
dirout = set(repolisx) - set(dirlis)
In [78]:
for dirz in dirout:
print dirz
In [79]:
dirme
Out[79]:
In [80]:
merglis = set(dirlis) & set(repolisx)
In [81]:
merglis
Out[81]:
In [ ]:
for repoit in repolisx:
print repoit
os.system('git clone https://github.com/wcmckee/' + repoit)
#git.Git().clone('https://github.com/wcmckee/' + repoit)
In [83]:
wcmrepo = git.repository('/home/wcmckee/wcmkee')
In [84]:
help('git')
In [84]:
In [85]:
import git
In [86]:
from git import *
repo = Repo("/Users/mtrier/Development/git-python")
In [87]:
git.Repository.clone('https://github.com/wcmckee/BeOk')
In [88]:
git.repository.Repository.clone()
In [89]:
(git.objects)
Out[89]:
In [ ]: