Home Explore Blog CI



git

2nd chunk of `Documentation/RelNotes/1.5.0.adoc`
93de94cae8a46c6e13d46f4c4b45e15a83bdae999e11256e0000000100000fbf
 yesterday's tip of the branch).


Updates in v1.5.0 since v1.4.4 series
-------------------------------------

* Index manipulation

 - git-add is to add contents to the index (aka "staging area"
   for the next commit), whether the file the contents happen to
   be is an existing one or a newly created one.

 - git-add without any argument does not add everything
   anymore.  Use 'git-add .' instead.  Also you can add
   otherwise ignored files with an -f option.

 - git-add tries to be more friendly to users by offering an
   interactive mode ("git-add -i").

 - git-commit <path> used to refuse to commit if <path> was
   different between HEAD and the index (i.e. update-index was
   used on it earlier).  This check was removed.

 - git-rm is much saner and safer.  It is used to remove paths
   from both the index file and the working tree, and makes sure
   you are not losing any local modification before doing so.

 - git-reset <tree> <paths>... can be used to revert index
   entries for selected paths.

 - git-update-index is much less visible.  Many suggestions to
   use the command in git output and documentation have now been
   replaced by simpler commands such as "git add" or "git rm".


* Repository layout and objects transfer

 - The data for origin repository is stored in the configuration
   file $GIT_DIR/config, not in $GIT_DIR/remotes/, for newly
   created clones.  The latter is still supported and there is
   no need to convert your existing repository if you are
   already comfortable with your workflow with the layout.

 - git-clone always uses what is known as "separate remote"
   layout for a newly created repository with a working tree.

   A repository with the separate remote layout starts with only
   one default branch, 'master', to be used for your own
   development.  Unlike the traditional layout that copied all
   the upstream branches into your branch namespace (while
   renaming their 'master' to your 'origin'), the new layout
   puts upstream branches into local "remote-tracking branches"
   with their own namespace. These can be referenced with names
   such as "origin/$upstream_branch_name" and are stored in
   .git/refs/remotes rather than .git/refs/heads where normal
   branches are stored.

   This layout keeps your own branch namespace less cluttered,
   avoids name collision with your upstream, makes it possible
   to automatically track new branches created at the remote
   after you clone from it, and makes it easier to interact with
   more than one remote repository (you can use "git remote" to
   add other repositories to track).  There might be some
   surprises:

   * 'git branch' does not show the remote tracking branches.
     It only lists your own branches.  Use '-r' option to view
     the tracking branches.

   * If you are forking off of a branch obtained from the
     upstream, you would have done something like 'git branch
     my-next next', because traditional layout dropped the
     tracking branch 'next' into your own branch namespace.
     With the separate remote layout, you say 'git branch next
     origin/next', which allows you to use the matching name
     'next' for your own branch.  It also allows you to track a
     remote other than 'origin' (i.e. where you initially cloned
     from) and fork off of a branch from there the same way
     (e.g. "git branch mingw j6t/master").

   Repositories initialized with the traditional layout continue
   to work.

 - New branches that appear on the origin side after a clone is
   made are also tracked automatically.  This is done with an
   wildcard refspec "refs/heads/*:refs/remotes/origin/*", which
   older git does not understand, so if you clone with 1.5.0,
   you would need to downgrade remote.*.fetch in the
   configuration file to specify each branch you are interested
   in individually if you plan to fetch into the repository with
   older versions of git (but why would you?).

 - Similarly, wildcard refspec "refs/heads/*:refs/remotes/me/*"

Title: GIT 1.5.0 Updates and Changes
Summary
The updates in GIT version 1.5.0 include changes to index manipulation commands such as git-add and git-rm, as well as changes to repository layout and objects transfer, including a new separate remote layout for clones and automatic tracking of new branches from the origin.