1
0
mirror of https://github.com/git/git.git synced 2025-04-08 20:25:51 +00:00
Junio C Hamano e4b0e4ab8e detached HEAD -- finishing touches
This updates "git-checkout" to report which branch you are
switching to.  Especially for people who do not use __git_ps1
from contrib/completion/git-completion.bash this would give a
friendlier feedback of what is going on, and should make the
reminder message much less scary.

Here is a sample session (the prompt tells which branch I am on).

* I have some local modification and realize that the change deserves
  to be on its own new topic branch.

    [git.git (master)]$ git diff --stat
     git-checkout.sh |   10 ++++++++--
     1 files changed, 8 insertions(+), 2 deletions(-)

* So I switch to a new branch.  I get a listing of local modifications
  and assuring "Switched to a new branch" message.

    [git.git (master)]$ git checkout -b jc/checkout
    M       git-checkout.sh
    Switched to a new branch "jc/checkout"

* If I switch back to "master", I get essentially the same.

    [git.git (jc/checkout)]$ git checkout master
    M       git-checkout.sh
    Switched to branch "master"

* Detaching head would say which commit I am at and reminds me that
  I am not on any branch (not that I would detach my HEAD while keeping
  precious local changes around in any real-world workflow -- this is
  just a sample session).

    [git.git (master)]$ git checkout master^
    M       git-checkout.sh
    Note: you are not on any branch and are at commit "master^"
    If you want to create a new branch from this checkout, you may do so
    (now or later) by using -b with the checkout command again. Example:
      git checkout -b <new_branch_name>

* Coming back to an attached state can lose the detached HEAD, so
  I get warned and stopped.

    [git.git]$ git checkout master
    You are not on any branch and switching to branch 'master'
    may lose your changes.  At this point, you can do one of two things:
     (1) Decide it is Ok and say 'git checkout -f master';
     (2) Start a new branch from the current commit, by saying
         'git checkout -b <branch-name>'.
    Leaving your HEAD detached; not switching to branch 'master'.

* Moving around while my HEAD is detached is Ok.  I still get the list
  of local modifications.

    [git.git]$ git checkout master^0
    M       git-checkout.sh

* The previous step that switched to the tip commit is an obscure but
  useful trick.  My HEAD is still detached but now it is pointed at by
  an existing ref, so I can come back safely.

    [git.git]$ git checkout master
    M       git-checkout.sh
    Switched to branch "master"

* And we are back on the "master" branch.

    [git.git (master)]$ exit

Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-01 01:10:15 -08:00
2006-07-10 00:36:44 -07:00
2007-01-22 16:25:15 -08:00
2007-01-21 21:29:57 -08:00
2006-05-01 22:29:16 -07:00
2006-10-26 02:07:18 -07:00
2006-11-21 20:55:39 -08:00
2005-12-27 10:49:25 -08:00
2005-08-09 22:28:19 -07:00
2005-10-14 17:17:27 -07:00
2007-01-28 12:31:56 -08:00
2007-01-20 18:57:47 -08:00
2006-05-15 12:32:13 -07:00
2006-12-29 11:01:31 -08:00
2006-03-05 02:47:29 -08:00
2007-01-11 16:50:36 -08:00
2007-01-31 13:09:58 -08:00
2007-01-31 13:09:58 -08:00
2006-02-06 21:43:27 -08:00
2006-02-06 21:43:27 -08:00
2005-09-07 17:45:20 -07:00
2007-01-18 14:22:24 -08:00
2007-01-30 21:03:11 -08:00
2007-01-31 15:41:49 -08:00
2007-01-29 09:36:21 -08:00
2006-09-27 23:59:09 -07:00
2006-06-26 14:58:41 -07:00
2006-09-14 11:48:11 -07:00
2006-08-31 16:24:39 -07:00
2007-01-11 16:47:34 -08:00
2007-01-09 03:04:04 -08:00
2007-01-17 12:03:50 -08:00
2007-01-30 02:30:25 -08:00
2006-03-05 02:47:29 -08:00
2006-10-20 16:50:36 -07:00
2005-11-02 16:50:58 -08:00
2006-03-25 16:35:43 -08:00
2006-10-26 18:31:17 -07:00

////////////////////////////////////////////////////////////////

	GIT - the stupid content tracker

////////////////////////////////////////////////////////////////

"git" can mean anything, depending on your mood.

 - random three-letter combination that is pronounceable, and not
   actually used by any common UNIX command.  The fact that it is a
   mispronunciation of "get" may or may not be relevant.
 - stupid. contemptible and despicable. simple. Take your pick from the
   dictionary of slang.
 - "global information tracker": you're in a good mood, and it actually
   works for you. Angels sing, and a light suddenly fills the room.
 - "goddamn idiotic truckload of sh*t": when it breaks

Git is a fast, scalable, distributed revision control system with an
unusually rich command set that provides both high-level operations
and full access to internals.

Git is an Open Source project covered by the GNU General Public License.
It was originally written by Linus Torvalds with help of a group of
hackers around the net. It is currently maintained by Junio C Hamano.

Please read the file INSTALL for installation instructions.
See Documentation/tutorial.txt to get started, then see
Documentation/everyday.txt for a useful minimum set of commands,
and "man git-commandname" for documentation of each command.
CVS users may also want to read Documentation/cvs-migration.txt.

Many Git online resources are accessible from http://git.or.cz/
including full documentation and Git related tools.

The user discussion and development of Git take place on the Git
mailing list -- everyone is welcome to post bug reports, feature
requests, comments and patches to git@vger.kernel.org. To subscribe
to the list, send an email with just "subscribe git" in the body to
majordomo@vger.kernel.org. The mailing list archives are available at
http://marc.theaimsgroup.com/?l=git and other archival sites.
Description
Git Source Code Mirror - This is a publish-only repository but pull requests can be turned into patches to the mailing list via GitGitGadget (https://gitgitgadget.github.io/). Please follow Documentation/SubmittingPatches procedure for any of your improvements.
Readme 822 MiB
Languages
C 50.1%
Shell 38.4%
Perl 5.1%
Tcl 3.2%
Python 0.8%
Other 2.1%