]> git.phdru.name Git - git-wiki.git/blobdiff - pep-103.txt
Add section "SSH connection sharing"
[git-wiki.git] / pep-103.txt
index f6e8e6d4d8d7d8e780910de4e0f189a37d65b753..993ad2dc9e5476b3bcb650c268dd34fcb7bd0969 100644 (file)
@@ -82,18 +82,18 @@ Unix users: `download and install using your package manager
 <https://git-scm.com/download/linux>`_.
 
 Microsoft Windows: download `git-for-windows
-<https://github.com/git-for-windows/git/releases>`_ or `msysGit
-<https://github.com/msysgit/msysgit/releases>`_.
+<https://github.com/git-for-windows/git/releases>`_.
 
 MacOS X: use git installed with `XCode
-<https://developer.apple.com/xcode/downloads/>`_ or download from
-`MacPorts <https://www.macports.org/ports.php?by=name&substr=git>`_ or
+<https://developer.apple.com/xcode/>`_ or download from `MacPorts
+<https://www.macports.org/ports.php?by=name&substr=git>`_ or
 `git-osx-installer
 <http://sourceforge.net/projects/git-osx-installer/files/>`_ or
 install git with `Homebrew <http://brew.sh/>`_: ``brew install git``.
 
-`git-cola <https://git-cola.github.io/index.html>`_ is a Git GUI
-written in Python and GPL licensed. Linux, Windows, MacOS X.
+`git-cola <https://git-cola.github.io/index.html>`_ (`repository
+<https://github.com/git-cola/git-cola>`__) is a Git GUI written in
+Python and GPL licensed. Linux, Windows, MacOS X.
 
 `TortoiseGit <https://tortoisegit.org/>`_ is a Windows Shell Interface
 to Git based on TortoiseSVN; open source.
@@ -440,7 +440,7 @@ Read `how to recover from upstream rebase
 <https://git-scm.com/docs/git-rebase#_recovering_from_upstream_rebase>`_.
 It is in ``git help rebase``.
 
-On the other hand don't be too afraid about commit editing. You can
+On the other hand, don't be too afraid about commit editing. You can
 safely edit, reorder, remove, combine and split commits that haven't
 been pushed yet. You can even push commits to your own (backup) repo,
 edit them later and force-push edited commits to replace what have
@@ -532,11 +532,11 @@ For example, if you want to reset the branch ``master`` back to the
 original commit but preserve two commits created in the current branch
 do something like::
 
-    $ git branch save-master # create a new branch saving master
-    $ git reflog # find the original place of master
+    $ git branch save-master  # create a new branch saving master
+    $ git reflog  # find the original place of master
     $ git reset $COMMIT_ID
     $ git cherry-pick save-master~ save-master
-    $ git branch -D save-master # remove temporary branch
+    $ git branch -D save-master  # remove temporary branch
 
 
 git revert: revert a commit
@@ -714,6 +714,25 @@ command. For example::
 $ git check-attr -a -- \*.py
 
 
+Useful assets
+-------------
+
+`GitAlias <http://gitalias.com/>`_ (`repository
+<https://github.com/GitAlias/gitalias>`_) is a big collection of
+aliases. A careful selection of aliases for frequently used commands
+could save you a lot of keystrokes!
+
+`GitIgnore <https://www.gitignore.io/>`_ and
+https://github.com/github/gitignore are collections of ``.gitignore``
+files for all kinds of IDEs and programming languages. Python
+included!
+
+`pre-commit <http://pre-commit.com/>`_ (`repositories
+<https://github.com/pre-commit>`_) is a framework for managing and
+maintaining multi-language pre-commit hooks. The framework is written
+in Python and has a lot of plugins for many programming languages.
+
+
 Advanced topics
 ===============
 
@@ -754,7 +773,7 @@ Wiki.
 
 
 Root
-====
+----
 
 Git switches to the root (top-level directory of the project where
 ``.git`` subdirectory exists) before running any command. Git
@@ -782,7 +801,7 @@ we run the commands from a subdirectory, not from the root.
 
 
 ReReRe
-======
+------
 
 Rerere is a mechanism that helps to resolve repeated merge conflicts.
 The most frequent source of recurring merge conflicts are topic
@@ -811,7 +830,7 @@ Book.
 
 
 Database maintenance
-====================
+--------------------
 
 Git object database and other files/directories under ``.git`` require
 periodic maintenance and cleanup. For example, commit editing left
@@ -869,7 +888,7 @@ has an option ``-O`` that passes a list of names of the found files to
 a program; default program for ``-O`` is a pager (usually ``less``),
 but you can use your editor::
 
-    $ git grep -Ovim # but not -O vim
+    $ git grep -Ovim  # but not -O vim
 
 BTW, if git is instructed to use ``less`` as the pager (i.e., if pager
 is not configured in git at all it uses ``less`` by default, or if it
@@ -914,6 +933,38 @@ Read the detailed instructions in the file.
 Search the Net for "git prompt" to find other prompt variants.
 
 
+SSH connection sharing
+----------------------
+
+SSH connection sharing is a feature of OpenSSH and perhaps derivatives
+like PuTTY. SSH connection sharing is a way to decrease ssh client
+startup time by establishing one connection and reusing it for all
+subsequent clients connecting to the same server. SSH connection
+sharing can be used to speedup a lot of short ssh sessions like scp,
+sftp, rsync and of course git over ssh. If you regularly
+fetch/pull/push from/to remote repositories accessible over ssh then
+using ssh connection sharing is recommended.
+
+To turn on ssh connection sharing add something like this to your
+~/.ssh/config::
+
+    Host *
+    ControlMaster auto
+    ControlPath ~/.ssh/mux-%r@%h:%p
+    ControlPersist 600
+
+See `OpenSSH wikibook
+<https://en.wikibooks.org/wiki/OpenSSH/Cookbook/Multiplexing>`_ and
+`search <https://www.google.com/search?q=ssh+connection+sharing>`_ for
+more information.
+
+SSH connection sharing can be used at GitHub, GitLab and SourceForge
+repositories, but please be advised that BitBucket doesn't allow it
+and forcibly closes master connection after a short inactivity period
+so you will see errors like this from ssh: "Connection to bitbucket.org
+closed by remote host."
+
+
 git on server
 =============
 
@@ -950,12 +1001,12 @@ and communication. Among these environments are `Kallithea
 <https://kallithea-scm.org/>`_ and `pagure <https://pagure.io/>`_,
 both are written in Python; pagure was written by Fedora developers
 and is being used to develop some Fedora projects. `GitPrep
-<http://gitprep.yukikimoto.com/>`_ is yet another Github clone,
+<http://gitprep.yukikimoto.com/>`_ is yet another GitHub clone,
 written in Perl. `Gogs <https://gogs.io/>`_ is written in Go.
-`GitBucket <https://takezoe.github.io/gitbucket/about/>`_ is written
-in Scala.
+`GitBucket <https://gitbucket.github.io/gitbucket-news/about/>`_ is
+written in Scala.
 
-And last but not least, `Gitlab <https://about.gitlab.com/>`_. It's
+And last but not least, `GitLab <https://about.gitlab.com/>`_. It's
 perhaps the most advanced web-based development environment for git.
 Written in Ruby, community edition is free and open source (MIT
 license).
@@ -989,7 +1040,7 @@ To work with the repository just use regular git commands including
 
 To start converting your Mercurial habits to git see the page
 `Mercurial for Git users
-<https://mercurial.selenic.com/wiki/GitConcepts>`_ at Mercurial wiki.
+<https://www.mercurial-scm.org/wiki/GitConcepts>`_ at Mercurial wiki.
 At the second half of the page there is a table that lists
 corresponding Mercurial and git commands. Should work perfectly in
 both directions.
@@ -999,6 +1050,17 @@ developers <https://docs.python.org/devguide/gitdevs.html>`_ that
 documents a few differences between git and hg.
 
 
+Git and GitHub
+==============
+
+`gitsome <https://github.com/donnemartin/gitsome>`_ - Git/GitHub
+command line interface (CLI). Written in Python, work on MacOS, Unix,
+Windows. Git/GitHub CLI with autocomplete, includes many GitHub
+integrated commands that work with all shells, builtin xonsh with
+Python REPL to run Python commands alongside shell commands, command
+history, customizable highlighting, thoroughly documented.
+
+
 Copyright
 =========