https://github.com/julienpeloton/git-r
Manage git repo from a distant location (within the same machine)
https://github.com/julienpeloton/git-r
git remote
Last synced: about 2 months ago
JSON representation
Manage git repo from a distant location (within the same machine)
- Host: GitHub
- URL: https://github.com/julienpeloton/git-r
- Owner: JulienPeloton
- License: gpl-3.0
- Created: 2017-12-12T11:49:25.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-14T09:48:26.000Z (over 8 years ago)
- Last Synced: 2026-04-21T13:26:24.321Z (2 months ago)
- Topics: git, remote
- Language: Python
- Homepage:
- Size: 230 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.rst
- License: LICENSE
Awesome Lists containing this project
README
=============================
git-r
=============================
.. image:: https://travis-ci.org/JulienPeloton/git-r.svg?branch=master
:target: https://travis-ci.org/JulienPeloton/git-r
.. contents:: **Table of Contents**
What is git-r?
===============
git-r is a python module to manage git repositories from a distant folder.
We provide an executable ``git-r`` which is a wrapper around the traditional ``git`` command
and can be called from any location to make change to a particular git repository on the machine.
Requirements
===============
No special dependencies. Work for both python2.7 and python 3.X.
Installation
===============
The best is to use pip
::
pip install git-r
Make sure that the executable is in your path.
Quick examples
===============
The general usage is very simple
::
git-r []
Note that ``command`` can be any git commands.
Say now I have a repo at ``/some/path/repo``. First, you need to create the
.git-rrc file in your ``$HOME`` and register ``repo`` (see the example provided).
git-r allows you to do that from the command line:
::
julien:workspace$ git-r add_repo /some/path/repo
.git-rrc does not exist. Now created at $HOME/.git-rrc.
This message will appear only once when the file is created.
Then you can as many repo as you want. You can also overwrite the location of
an old repo:
::
julien:workspace$ git-r add_repo /some/new/path/repo
+---------------------------+
Repo already in the .git-rrc file!
Path used is /some/path/repo
Do you want to overwrite it? [Y/n]
**Example 1: Pull**
Imagine I am working from a distant folder ``/some/other/path/workspace`` (but still the same machine!)
and I want to pull the latest change from ``repo``:
::
julien:workspace$ git-r pull repo
Repo: /some/path/repo
Already up-to-date.
julien:workspace$
**Example 2: Changing branch**
Imagine I am working from a distant folder ``/some/other/path/workspace`` (but still the same machine!)
and I want to switch from the ``master`` branch to ``mybranch`` branch in ``repo``:
::
julien:workspace$ git-r checkout mybranch repo
Repo: /some/path/repo
Switched to branch 'mybranch'
Your branch is up-to-date with 'origin/mybranch'.
julien:workspace$
Support
===============
.. raw:: html