

commit ( "Added a new file in the past - for later merege" ) # prepare a merge master = cloned_repo. add () # add it to the index # Commit the changes to deviate masters history cloned_repo.

close () # create new file in working tree cloned_repo. working_tree_dir, 'my-new-file' ) open ( new_file_path, 'wb' ). commit ) # Now the past is checked out new_file_path = os. active_branch ) # checking out branch adjusts the wtree self. Our index implementation allows to stream date into the index, which is useful for bare repositories that do not have a working tree. It is used to prepare new commits, and can be used to keep results of merge operations. The index is also called stage in git-speak. exists () # push and pull behave very similarly set_reference ( bare_master ) assert not bare_repo. We specify the name statically, but you have all # information to do it programatically as well. commit )) # create a local branch at the latest fetched master. fetch ( progress = MyProgressPrinter ()): print ( "Updated %s to %s " % ( fetch_info. create_remote ( 'origin', url = cloned_repo. remotes ), 0 ) # this one was just initialized origin = bare_repo. remotes ), 1 ) # we have been cloned, so should be one remote self.

Git bash python 3 install update#
From git import RemoteProgress class MyProgressPrinter ( RemoteProgress ): def update ( self, op_code, cur_count, max_count = None, message = '' ): print ( op_code, cur_count, max_count, cur_count / ( max_count or 100.0 ), message or "NO MESSAGE" ) # end self.
