Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdf65f51

Browse files
forresthopkinsaByron
authored andcommitted
Update Remotes section (#502)
Update Remotes sectionThe Remotes section was missing some pretty important info.
1 parent31ad0a0 commitdf65f51

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

‎git/test/test_docs.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,8 +373,13 @@ def test_references_and_objects(self, rw_dir):
373373
assertorigin==empty_repo.remotes.origin==empty_repo.remotes['origin']
374374
origin.fetch()# assure we actually have data. fetch() returns useful information
375375
# Setup a local tracking branch of a remote branch
376-
empty_repo.create_head('master',origin.refs.master).set_tracking_branch(origin.refs.master)
377-
origin.rename('new_origin')# rename remotes
376+
empty_repo.create_head('master',origin.refs.master)# create local branch "master" from remote branch "master"
377+
empty_repo.heads.master.set_tracking_branch(origin.refs.master)# set local "master" to track remote "master
378+
empty_repo.heads.master.checkout()# checkout local "master" to working tree
379+
# Three above commands in one:
380+
empty_repo.create_head('master',origin.refs.master).set_tracking_branch(origin.refs.master).checkout()
381+
# rename remotes
382+
origin.rename('new_origin')
378383
# push and pull behaves similarly to `git push|pull`
379384
origin.pull()
380385
origin.push()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp