Skip to content

Commit df65f51

Browse files
forresthopkinsaByron
authored andcommitted
Update Remotes section (#502)
Update Remotes section The Remotes section was missing some pretty important info.
1 parent 31ad0a0 commit df65f51

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
assert origin == 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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy