diff options
Diffstat (limited to 'doc/source')
| -rw-r--r-- | doc/source/changes.rst | 3 | ||||
| -rw-r--r-- | doc/source/intro.rst | 19 | ||||
| -rw-r--r-- | doc/source/tutorial.rst | 16 |
3 files changed, 26 insertions, 12 deletions
diff --git a/doc/source/changes.rst b/doc/source/changes.rst index d81f90a6..60fe9725 100644 --- a/doc/source/changes.rst +++ b/doc/source/changes.rst @@ -6,6 +6,9 @@ Changelog ================ * Added `Repo.merge_base()` implementation. See the `respective issue on github <https://github.com/gitpython-developers/GitPython/issues/169>`_ * `[include]` sections in git configuration files are now respected +* Added `GitConfigParser.rename_section()` +* Added `Submodule.rename()` +* **POSSIBLY BREAKING CHANGE**: As `rev_parse` will now throw `BadName` as well as `BadObject`, client code will have to catch both exception types. * A list of all issues can be found here: https://github.com/gitpython-developers/GitPython/issues?q=milestone%3A%22v0.3.6+-+Features%22+ 0.3.5 - Bugfixes diff --git a/doc/source/intro.rst b/doc/source/intro.rst index 8dac2804..b767ccd7 100644 --- a/doc/source/intro.rst +++ b/doc/source/intro.rst @@ -17,9 +17,6 @@ Requirements It should also work with older versions, but it may be that some operations involving remotes will not work as expected. * `GitDB`_ - a pure python git database implementation - - * `async`_ - asynchronous task scheduling - * `Python Nose`_ - used for running the tests * `Mock by Michael Foord`_ used for tests. Requires version 0.5 @@ -27,29 +24,27 @@ Requirements .. _Python Nose: http://code.google.com/p/python-nose/ .. _Mock by Michael Foord: http://www.voidspace.org.uk/python/mock.html .. _GitDB: http://pypi.python.org/pypi/gitdb -.. _async: http://pypi.python.org/pypi/async Installing GitPython ==================== Installing GitPython is easily done using -`setuptools`_. Assuming it is +`pip`_. Assuming it is installed, just run the following from the command-line: .. sourcecode:: none - # easy_install GitPython + # pip install gitpython This command will download the latest version of GitPython from the `Python Package Index <http://pypi.python.org/pypi/GitPython>`_ and install it -to your system. More information about ``easy_install`` and pypi can be found +to your system. More information about ``pip`` and pypi can be found here: -* `setuptools`_ -* `install setuptools <http://peak.telecommunity.com/DevCenter/EasyInstall#installation-instructions>`_ +* `install pip <https://pip.pypa.io/en/latest/installing.html>`_ * `pypi <https://pypi.python.org/pypi/GitPython>`_ -.. _setuptools: http://peak.telecommunity.com/DevCenter/setuptools +.. _pip: https://pip.pypa.io/en/latest/installing.html Alternatively, you can install from the distribution using the ``setup.py`` script: @@ -58,7 +53,7 @@ script: # python setup.py install -.. note:: In this case, you have to manually install `GitDB`_ and `async`_ as well. It would be recommended to use the :ref:`git source repository <source-code-label>` in that case. +.. note:: In this case, you have to manually install `GitDB`_ as well. It would be recommended to use the :ref:`git source repository <source-code-label>` in that case. Getting Started =============== @@ -84,7 +79,7 @@ GitPython's git repo is available on GitHub, which can be browsed at: and cloned using:: - $ git clone git://github.com/gitpython-developers/GitPython.git git-python + $ git clone https://github.com/gitpython-developers/GitPython git-python Initialize all submodules to obtain the required dependencies with:: diff --git a/doc/source/tutorial.rst b/doc/source/tutorial.rst index 3f45b70d..4921d07b 100644 --- a/doc/source/tutorial.rst +++ b/doc/source/tutorial.rst @@ -415,6 +415,22 @@ The previous approach would brutally overwrite the user's changes in the working repo.heads.master.checkout() # checkout the branch using git-checkout repo.heads.other_branch.checkout() +Initializing a repository +************************* + +In this example, we will initialize an empty repository, add an empty file to the index, and commit the change:: + + repo_dir = 'my-new-repo' + file_name = os.path.join(repo_dir, 'new-file') + + r = git.Repo.init(repo_dir) + # This function just creates an empty file ... + touch(file_name) + r.index.add([file_name]) + r.index.commit("initial commit") + +Please have a look at the individual methods as they usually support a vast amount of arguments to customize their behavior. + Using git directly ****************** In case you are missing functionality as it has not been wrapped, you may conveniently use the git command directly. It is owned by each repository instance:: |
