示例#1
0
def tagIt(tagId):
    s('git add .')
    s('git commit -m "added files about to be tagged"')
    s('git log --pretty=oneline')
    commitId = input('\nenter characters of the commit id to tag: ')
    s('git tag', tagId, commitId)
    s('git show-ref --tags')
示例#2
0
def unix():
    s('cd myrepo')
    s('touch f1 f2 f3 f4')
    tagIt('1.0.0')
    s('touch g1 g2 g3 g4')
    tagIt('1.0.1')
    s('touch h1 h2 h3 h4')
    tagIt('1.0.2')
def unix():
    s('cd myrepo')
    s('touch f1 f2 f3 f4')
    tagIt('1.0.0')
    s('touch g1 g2 g3 g4')
    tagIt('1.0.1')
    s('touch h1 h2 h3 h4')
    tagIt('1.0.2')
def tagIt(tagId):
    #    s('git add .')
    #    s('git commit -m "added files about to be tagged"')
    s('git log --pretty=oneline')
    commitId = input(
        f'\nenter characters of the commit id to tag with {tagId}: ')
    s('git tag', tagId, commitId)
    s('git show-ref --tags')
    s('git log --pretty=oneline --decorate=full')
from single_step import s
s('cd myrepo')
s('git status')
s('git log')


示例#6
0
def windows():
    s('cd myrepo')
    s('copy nul > f1')
    s('copy nul > f2')
    s('copy nul > f3')
    s('copy nul > f4')
    tagIt('1.0.0')
    s('copy nul > g1')
    s('copy nul > g2')
    s('copy nul > g3')
    s('copy nul > g4')
    tagIt('1.0.1')
    s('copy nul > h1')
    s('copy nul > h2')
    s('copy nul > h3')
    s('copy nul > h4')
    tagIt('1.0.2')
示例#7
0
def unix():
    s('cd myrepo')
    s('touch f1 f2 f3 f4')
    s('touch g1 g2 g3 g4')
    s('git add .')
    s('git status')
    s('git commit -m "added some files with name beginning with f or g"')
    s('git push -u origin master')
import sys
from single_step import s


def tagIt(tagId):
    #    s('git add .')
    #    s('git commit -m "added files about to be tagged"')
    s('git log --pretty=oneline')
    commitId = input(
        f'\nenter characters of the commit id to tag with {tagId}: ')
    s('git tag', tagId, commitId)
    s('git show-ref --tags')
    s('git log --pretty=oneline --decorate=full')


s('cd myrepo')
tagIt('1.0.0')
tagIt('1.0.1')
tagIt('1.0.2')
def windows():
    s('deltree src')
    s('md src')
示例#10
0
from single_step import s

s('cd myrepo')

s('echo This was written to resolve the conflict > conflict_file')
s('git add conflict_file')
s('git commit -m "merged master and fixed conflict"')
s('git push -u origin master')

示例#11
0
from single_step import s

s("cd src/mysite")
s("python manage.py runserver 7001")
示例#12
0
import sys
from single_step import s

s('git config --global user.name')
s('git config --global user.email')
import sys
from single_step import s

s('cd myrepo')

s('git checkout mybranch')
s('echo This was written from the mybranch branch > conflict_file')
s('git add .')
s('git commit -m "adding a file to mybranch demonstrating conflicts"')
s('git push -u origin mybranch')

s('git checkout master')
s('echo This was written from the master branch > conflict_file')
s('git add .')
s('git commit -m "adding a file to master demonstrating conflicts"')
s('git push -u origin master')

s('git merge mybranch')

if sys.platform == "win32":
    s('type conflict_file')
else:
    s('cat conflict_file')
import sys, os
from single_step import s

code1 = r"""
from django.conf.urls import url

from . import views

urlpatterns = [
    url(r'^$', views.index, name='index'),
]
"""

code2 = r"""
from django.conf.urls import include, url
from django.contrib import admin

urlpatterns = [
    url(r'^polls/', include('polls.urls')),
    url(r'^admin/', admin.site.urls),
]
"""

s('cd src/mysite')
s('cat <<XXX >polls/urls.py ' + code1 + '\nXXX')
s('cat <<XXX >mysite/urls.py ' + code2 + '\nXXX')
示例#15
0
def unix():
    s('rm -rf src')
    s('mkdir src')
示例#16
0
def windows():
    s('deltree src')
    s('md src')
示例#17
0
import sys, os
from single_step import s


def windows():
    s('deltree src')
    s('md src')


def unix():
    s('rm -rf src')
    s('mkdir src')


if sys.platform == "win32":
    windows()
else:
    unix()

s('cd src')
s('django-admin startproject mysite')
示例#18
0
from single_step import s

s('cd myrepo')
s('git status')
s('git checkout master')
s('echo "hello world" > hello4.txt')
s('echo "hello world" > hello5.txt')
s('echo "hello world" > hello6.txt')
s('git add .')
s('git commit -m "more files for master branch"')
s('git push -u origin master')
def unix():
    s('rm -rf myrepo')
    s('mkdir myrepo')
    s('cd myrepo')
    s('git init')
    
    # add a README file and commit
    s('echo "This is my new repo" > README.txt')
    s('git add README.txt') 
    s('git commit -m "first commit"')
import sys
from single_step import s

s('cd myrepo')


s('git checkout mybranch')
s('echo This was written from the mybranch branch > conflict_file')
s('git add .')
s('git commit -m "adding a file to mybranch demonstrating conflicts"')
s('git push -u origin mybranch')

s('git checkout master')
s('echo This was written from the master branch > conflict_file')
s('git add .')
s('git commit -m "adding a file to master demonstrating conflicts"')
s('git push -u origin master')

s('git merge mybranch')


if sys.platform == "win32":
    s('type conflict_file')
else:
    s('cat conflict_file')    



from single_step import s
repo = "myrepo"
username = "******"
password = input("Enter password: "******"git remote add origin https://{0}:{1}@github.com/{0}/{2}.git".format(username, password, repo)



s('cd myrepo')
# make sure you have created the remote repo: myrepo
s(cmd)
s('git remote -v')
s('git push -u origin master')

import sys
from single_step import s

s('cd myrepo')
s('echo f\* > .gitignore')
s('echo g\* >> .gitignore')

if sys.platform == "win32":
    s('type .gitignore')
else:
    s('cat .gitignore')    
s('git rm -r --cached .')
s('git add .')
s('git commit -am "Remove ignored files"')
s('git push -u origin master')

示例#23
0
import sys
from single_step import s

s('cd myrepo')
s('echo f\* > .gitignore')
s('echo g\* >> .gitignore')

if sys.platform == "win32":
    s('type .gitignore')
else:
    s('cat .gitignore')
s('git rm -r --cached .')
s('git add .')
s('git commit -am "Remove ignored files"')
s('git push -u origin master')
import sys, os
from single_step import s

def windows():
    s('deltree src')
    s('md src')

def unix():
    s('rm -rf src')
    s('mkdir src')


if sys.platform == "win32":
    windows()
else:
    unix()

s('cd src')
s('django-admin startproject mysite')
from single_step import s

s('cd myrepo')
s('git log --graph --all --decorate')
s('git rev-list --remotes')
s('git branch')
def unix():
    s('rm -rf src')
    s('mkdir src')
from single_step import s

s('cd myrepo')
s('echo "hello world" > hello1.txt')
s('echo "hello world" > hello2.txt')
s('echo "hello world" > hello3.txt')
s('git add .') 
s('git commit -m "added more files"')
s('git push -u origin master')

import sys, os
from single_step import s

s('cd src/mysite/polls')
code = r"""
from django.http import HttpResponse


def index(request):
    return HttpResponse("Hello, world. You're at the polls index.")
"""

s('cat <<XXX >views.py ' + code + '\nXXX')
示例#29
0
from single_step import s

s('cd myrepo')
s('git merge mybranch')
s('git push -u origin master')
示例#30
0
def windows():
    s('cd myrepo')
    s('copy nul > f1')
    s('copy nul > f2')
    s('copy nul > f3')
    s('copy nul > f4')
    s('copy nul > g1')
    s('copy nul > g2')
    s('copy nul > g3')
    s('copy nul > g4')
    s('git add .')
    s('git status')
    s('git commit -m "added some files with name beginning with f or g"')
    s('git push -u origin master')
from single_step import s

s('cd myrepo')
s('git status')
s('git checkout master')
s('echo "hello world" > hello4.txt')
s('echo "hello world" > hello5.txt')
s('echo "hello world" > hello6.txt')
s('git add .') 
s('git commit -m "more files for master branch"')
s('git push -u origin master')

import sys, os
from single_step import s

s('cd src/mysite/polls')
code = r"""
from django.http import HttpResponse


def index(request):
    return HttpResponse("Hello, world. You're at the polls index.")
"""

s('cat <<XXX >views.py ' + code + '\nXXX' )
def windows():
    s(f'git config --global user.name "{githubUserName}"')
    s(f'git config --global user.email {githubEmail}')
    s('rd /S /Q myrepo')
    s('md myrepo')
    s('cd myrepo')
    s('git init')
    
    # add a README file and commit
    s('echo "This is my new repo" > README.txt')
    s('git add README.txt') 
    s('git commit -m "first commit"')
示例#34
0
from single_step import s

s('cd myrepo')
s('git status')
s('git log')
示例#35
0
import sys
from single_step import s

s('cd myrepo')
s('git branch mybranch')
s('git checkout mybranch')
 
s('echo "branch file no. 1" > branch1.txt')
s('echo "branch file no. 2" > branch2.txt')
s('echo "branch file no. 3" > branch3.txt')
if sys.platform == "win32":
    s('del hello3.txt')
else:
    s('rm hello3.txt')
s('git add .') 
s('git commit -m "created a new branch"')
s('git push --set-upstream origin mybranch')

示例#36
0
import sys
from single_step import s

# s('rm myrepo')
s('git init')

# add a README file and commit
s('echo "This is my new repo" > README.txt')
s('git add .')
s('git commit -m "first commit"')
#https://github.com/ithenis/python-course.git
repo = "python-filescourse"
username = "******"
password = raw_input("Enter password: "******"git remote add origin https://{0}:{1}@github.com/{0}/{2}.git".format(
    username, password, repo)

# make sure you have created the remote repo: myrepo
s(cmd)
s('git remote -v')
s('git push -u origin master')
示例#37
0
from single_step import s
#[email protected]:ithenis/python-course.git
repo = "python2"
username = "******"
password = raw_input("Enter password: "******"git remote add origin https://{0}:{1}@github.com/{0}/{2}.git".format(
    username, password, repo)

s('cd myrepo')
# make sure you have created the remote repo: myrepo
s(cmd)
s('git remote -v')
s('git push -u origin master')
示例#38
0
from single_step import s

s('cd myrepo')
s('echo "hello world" > hello1.txt')
s('echo "hello world" > hello2.txt')
s('echo "hello world" > hello3.txt')
s('git add .')
s('git commit -m "added more files"')
s('git push -u origin master')
def windows():
    s('cd myrepo')
    s('copy nul > f1')
    s('copy nul > f2')
    s('copy nul > f3')
    s('copy nul > f4')
    tagIt('1.0.0')
    s('copy nul > g1')
    s('copy nul > g2')
    s('copy nul > g3')
    s('copy nul > g4')
    tagIt('1.0.1')
    s('copy nul > h1')
    s('copy nul > h2')
    s('copy nul > h3')
    s('copy nul > h4')
    tagIt('1.0.2')
def windows():
    s('deltree myrepo')
    s('md myrepo')
    s('cd myrepo')
    s('git init')
    
    # add a README file and commit
    s('echo "This is my new repo" > README.txt')
    s('git add README.txt') 
    s('git commit -m "first commit"')
import sys, os
from single_step import s

s('cd src/mysite')
s('python manage.py startapp polls')