分布式版本控制系统 Git v2.9.0 发布

jopen 8年前
   <p style="text-align: center;"><img alt="" src="https://simg.open-open.com/show/5c560e139fb603958c1e10433cb8108b.jpg" /></p>    <p>    </p>    <p>Git是一个开源的分布式版本控制系统,可以有效、高速的处理从很小到非常大的项目版本管理。Git 是 Linus Torvalds 为了帮助管理 Linux 内核开发而开发的一个开放源码的版本控制软件。Torvalds 开始着手开发 Git 是为了作为一种过渡方案来替代 BitKeeper,后者之前一直是 Linux 内核开发人员在全球使用的主要源代码工具。开放源码社区中的有些人觉得BitKeeper 的许可证并不适合开放源码社区的工作,因此 Torvalds 决定着手研究许可证更为灵活的版本控制系统。尽管最初 Git 的开发是为了辅助 Linux 内核开发的过程,但是我们已经发现在很多其他自由软件项目中也使用了 Git。</p>    <h2>更新日志</h2>    <p>向后兼容性注意事项<br /> ----------------------------</p>    <p>The end-user facing Porcelain level commands in the "git diff" and<br /> "git log" family by default enable the rename detection; you can still<br /> use "diff.renames" configuration variable to disable this.</p>    <p>Merging two branches that have no common ancestor with "git merge" is<br /> by default forbidden now to prevent creating such an unusual merge by<br /> mistake.</p>    <p>The output formats of "git log" that indents the commit log message by<br /> 4 spaces now expands HT in the log message by default.  You can use<br /> the "--no-expand-tabs" option to disable this.</p>    <p>"git commit-tree" plumbing command required the user to always sign<br /> its result when the user sets the commit.gpgsign configuration<br /> variable, which was an ancient mistake, which this release corrects.<br /> A script that drives commit-tree, if it relies on this mistake, now<br /> needs to read commit.gpgsign and pass the -S option as necessary.</p>    <p><br /> Updates since v2.8<br /> ------------------</p>    <p>用户界面,工作流程及特点</p>    <p> * Comes with git-multimail 1.3.1 (in contrib/).</p>    <p> * The end-user facing commands like "git diff" and "git log"<br />    now enable the rename detection by default.</p>    <p> * The credential.helper configuration variable is cumulative and<br />    there is no good way to override it from the command line.  As<br />    a special case, giving an empty string as its value now serves<br />    as the signal to clear the values specified in various files.</p>    <p> * A new "interactive.diffFilter" configuration can be used to<br />    customize the diff shown in "git add -i" sessions.</p>    <p> * "git p4" now allows P4 author names to be mapped to Git author<br />    names.</p>    <p> * "git rebase -x" can be used without passing "-i" option.</p>    <p> * "git -c credential.<var>=<value> submodule" can now be used to<br />    propagate configuration variables related to credential helper<br />    down to the submodules.</p>    <p> * "git tag" can create an annotated tag without explicitly given an<br />    "-a" (or "-s") option (i.e. when a tag message is given).  A new<br />    configuration variable, tag.forceSignAnnotated, can be used to tell<br />    the command to create signed tag in such a situation.</p>    <p> * "git merge" used to allow merging two branches that have no common<br />    base by default, which led to a brand new history of an existing<br />    project created and then get pulled by an unsuspecting maintainer,<br />    which allowed an unnecessary parallel history merged into the<br />    existing project.  The command has been taught not to allow this by<br />    default, with an escape hatch "--allow-unrelated-histories" option<br />    to be used in a rare event that merges histories of two projects<br />    that started their lives independently.</p>    <p> * "git pull" has been taught to pass the "--allow-unrelated-histories"<br />    option to underlying "git merge".</p>    <p> * "git apply -v" learned to report paths in the patch that were<br />    skipped via --include/--exclude mechanism or being outside the<br />    current working directory.</p>    <p> * Shell completion (in contrib/) updates.</p>    <p> * The commit object name reported when "rebase -i" stops has been<br />    shortened.</p>    <p> * "git worktree add" can be given "--no-checkout" option to only<br />    create an empty worktree without checking out the files.</p>    <p> * "git mergetools" learned to drive ExamDiff.</p>    <p> * "git pull --rebase" learned "--[no-]autostash" option, so that<br />    the rebase.autostash configuration variable set to true can be<br />    overridden from the command line.</p>    <p> * When "git log" shows the log message indented by 4-spaces, the<br />    remainder of a line after a HT does not align in the way the author<br />    originally intended.  The command now expands tabs by default to help<br />    such a case, and allows the users to override it with a new option,<br />    "--no-expand-tabs".</p>    <p> * "git send-email" now uses a more readable timestamps when<br />    formulating a message ID.</p>    <p> * "git rerere" can encounter two or more files with the same conflict<br />    signature that have to be resolved in different ways, but there was<br />    no way to record these separate resolutions.</p>    <p> * "git p4" learned to record P4 jobs in Git commit that imports from<br />    the history in Perforce.</p>    <p> * "git describe --contains" often made a hard-to-justify choice of<br />    tag to name a given commit, because it tried to come up<br />    with a name with smallest number of hops from a tag, causing an old<br />    commit whose close descendant that is recently tagged were not<br />    described with respect to an old tag but with a newer tag.  It did<br />    not help that its computation of "hop" count was further tweaked to<br />    penalize being on a side branch of a merge.  The logic has been<br />    updated to favor using the tag with the oldest tagger date, which<br />    is a lot easier to explain to the end users: "We describe a commit<br />    in terms of the (chronologically) oldest tag that contains the<br />    commit."</p>    <p> * "git clone" learned the "--shallow-submodules" option.</p>    <p> * HTTP transport clients learned to throw extra HTTP headers at the<br />    server, specified via http.extraHeader configuration variable.</p>    <p> * The "--compaction-heuristic" option to "git diff" family of<br />    commands enables a heuristic to make the patch output more readable<br />    by using a blank line as a strong hint that the contents before and<br />    after it belong to logically separate units.  It is still<br />    experimental.</p>    <p> * A new configuration variable core.hooksPath allows customizing<br />    where the hook directory is.</p>    <p> * An earlier addition of "sanitize_submodule_env" with 14111fc4 (git:<br />    submodule honor -c credential.* from command line, 2016-02-29)<br />    turned out to be a convoluted no-op; implement what it wanted to do<br />    correctly, and stop filtering settings given via "git -c var=val".</p>    <p> * "git commit --dry-run" reported "No, no, you cannot commit." in one<br />    case where "git commit" would have allowed you to commit, and this<br />    improves it a little bit ("git commit --dry-run --short" still does<br />    not give you the correct answer, for example).  This is a stop-gap<br />    measure in that "commit --short --dry-run" still gives an incorrect<br />    result.</p>    <p> * The experimental "multiple worktree" feature gains more safety to<br />    forbid operations on a branch that is checked out or being actively<br />    worked on elsewhere, by noticing that e.g. it is being rebased.</p>    <p> * "git format-patch" learned a new "--base" option to record what<br />    (public, well-known) commit the original series was built on in<br />    its output.</p>    <p> * "git commit" learned to pay attention to the "commit.verbose"<br />    configuration variable and act as if the "--verbose" option<br />    was given from the command line.</p>    <p> * Updated documentation gives hints to GMail users with two-factor<br />    auth enabled that they need app-specific-password when using<br />    "git send-email".</p>    <p> * The manpage output of our documentation did not render well in<br />    terminal; typeset literals in bold by default to make them stand<br />    out more.</p>    <p> * The mark-up in the top-level README.md file has been updated to<br />    typeset CLI command names differently from the body text.</p>    <p>性能方面,内部实施,开发支持等:</p>    <p> * The embedded args argv-array in the child process is used to build<br />    the command line to run pack-objects instead of using a separate<br />    array of strings.</p>    <p> * A test for tags has been restructured so that more parts of it can<br />    easily be run on a platform without a working GnuPG.</p>    <p> * The startup_info data, which records if we are working inside a<br />    repository (among other things), are now uniformly available to Git<br />    subcommand implementations, and Git avoids attempting to touch<br />    references when we are not in a repository.</p>    <p> * The command line argument parser for "receive-pack" has been<br />    rewritten to use parse-options.</p>    <p> * A major part of "git submodule update" has been ported to C to take<br />    advantage of the recently added framework to run download tasks in<br />    parallel.  Other updates to "git submodule" that move pieces of<br />    logic to C continues.</p>    <p> * Rename bunch of tests on "git clone" for better organization.</p>    <p> * The tests that involve running httpd leaked the system-wide<br />    configuration in /etc/gitconfig to the tested environment.</p>    <p> * Build updates for MSVC.</p>    <p> * The repository set-up sequence has been streamlined (the biggest<br />    change is that there is no longer git_config_early()), so that we<br />    do not attempt to look into refs/* when we know we do not have a<br />    Git repository.</p>    <p> * Code restructuring around the "refs" API to prepare for pluggable<br />    refs backends.</p>    <p> * Sources to many test helper binaries and the generated helpers<br />    have been moved to t/helper/ subdirectory to reduce clutter at the<br />    top level of the tree.</p>    <p> * Unify internal logic between "git tag -v" and "git verify-tag"<br />    commands by making one directly call into the other.</p>    <p> * "merge-recursive" strategy incorrectly checked if a path that is<br />    involved in its internal merge exists in the working tree.</p>    <p> * The test scripts for "git p4" (but not "git p4" implementation<br />    itself) has been updated so that they would work even on a system<br />    where the installed version of Python is python 3.</p>    <p> * As nobody maintains our in-tree git.spec.in and distros use their<br />    own spec file, we stopped pretending that we support "make rpm".</p>    <p> * Move from "unsigned char[20]" to "struct object_id" continues.</p>    <p> * The code for warning_errno/die_errno has been refactored and a new<br />    error_errno() reporting helper is introduced.<br />    (merge 1da045f nd/error-errno later to maint).</p>    <p> * Running tests with '-x' option to trace the individual command<br />    executions is a useful way to debug test scripts, but some tests<br />    that capture the standard error stream and check what the command<br />    said can be broken with the trace output mixed in.  When running<br />    our tests under "bash", however, we can redirect the trace output<br />    to another file descriptor to keep the standard error of programs<br />    being tested intact.</p>    <p> * t0040 had too many unnecessary repetitions in its test data.  Teach<br />    test-parse-options program so that a caller can tell what it<br />    expects in its output, so that these repetitions can be cleaned up.</p>    <p> * Add perf test for "rebase -i".</p>    <p> * Common mistakes when writing gitlink: in our documentation are<br />    found by "make check-docs".</p>    <p> * t9xxx series has been updated primarily for readability, while<br />    fixing small bugs in it.  A few scripted Porcelain commands have<br />    also been updated to fix possible bugs around their use of<br />    "test -z" and "test -n".</p>    <p> * CI test was taught to run git-svn tests.</p>    <p> * "git cat-file --batch-all" has been sped up, by taking advantage<br />    of the fact that it does not have to read a list of objects, in two<br />    ways.</p>    <p> * test updates to make it more readable and maintainable.<br />    (merge e6273f4 es/t1500-modernize later to maint).</p>    <p> * "make DEVELOPER=1" worked as expected; setting DEVELOPER=1 in<br />    config.mak didn't.<br />    (merge 51dd3e8 mm/makefile-developer-can-be-in-config-mak later to maint).</p>    <p> * The way how "submodule--helper list" signals unmatch error to its<br />    callers has been updated.</p>    <p> * A bash-ism "local" has been removed from "git submodule" scripted<br />    Porcelain.</p>    <p><br /> Also contains various documentation updates and code clean-ups.</p>    <p><br /> Fixes since v2.8<br /> ----------------</p>    <p>Unless otherwise noted, all the fixes since v2.8 in the maintenance<br /> track are contained in this release (see the maintenance releases'<br /> notes for details).</p>    <p> * "git config --get-urlmatch", unlike other variants of the "git<br />    config --get" family, did not signal error with its exit status<br />    when there was no matching configuration.</p>    <p> * The "--local-env-vars" and "--resolve-git-dir" options of "git<br />    rev-parse" failed to work outside a repository when the command's<br />    option parsing was rewritten in 1.8.5 era.</p>    <p> * "git index-pack --keep[=<msg>] pack-$name.pack" simply did not work.</p>    <p> * Fetching of history by naming a commit object name directly didn't<br />    work across remote-curl transport.</p>    <p> * A small memory leak in an error codepath has been plugged in xdiff<br />    code.</p>    <p> * strbuf_getwholeline() did not NUL-terminate the buffer on certain<br />    corner cases in its error codepath.</p>    <p> * "git mergetool" did not work well with conflicts that both sides<br />    deleted.</p>    <p> * "git send-email" had trouble parsing alias file in mailrc format<br />    when lines in it had trailing whitespaces on them.</p>    <p> * When "git merge --squash" stopped due to conflict, the concluding<br />    "git commit" failed to read in the SQUASH_MSG that shows the log<br />    messages from all the squashed commits.</p>    <p> * "git merge FETCH_HEAD" dereferenced NULL pointer when merging<br />    nothing into an unborn history (which is arguably unusual usage,<br />    which perhaps was the reason why nobody noticed it).</p>    <p> * When "git worktree" feature is in use, "git branch -d" allowed<br />    deletion of a branch that is checked out in another worktree,<br />    which was wrong.</p>    <p> * When "git worktree" feature is in use, "git branch -m" renamed a<br />    branch that is checked out in another worktree without adjusting<br />    the HEAD symbolic ref for the worktree.</p>    <p> * "git diff -M" used to work better when two originally identical<br />    files A and B got renamed to X/A and X/B by pairing A to X/A and B<br />    to X/B, but this was broken in the 2.0 timeframe.</p>    <p> * "git send-pack --all <there>" was broken when its command line<br />    option parsing was written in the 2.6 timeframe.</p>    <p> * "git format-patch --help" showed `-s` and `--no-patch` as if these<br />    are valid options to the command.  We already hide `--patch` option<br />    from the documentation, because format-patch is about showing the<br />    diff, and the documentation now hides these options as well.</p>    <p> * When running "git blame $path" with unnormalized data in the index<br />    for the path, the data in the working tree was blamed, even though<br />    "git add" would not have changed what is already in the index, due<br />    to "safe crlf" that disables the line-end conversion.  It has been<br />    corrected.</p>    <p> * A change back in version 2.7 to "git branch" broke display of a<br />    symbolic ref in a non-standard place in the refs/ hierarchy (we<br />    expect symbolic refs to appear in refs/remotes/*/HEAD to point at<br />    the primary branch the remote has, and as .git/HEAD to point at the<br />    branch we locally checked out).</p>    <p> * A partial rewrite of "git submodule" in the 2.7 timeframe changed<br />    the way the gitdir: pointer in the submodules point at the real<br />    repository location to use absolute paths by accident.  This has<br />    been corrected.</p>    <p> * "git commit" misbehaved in a few minor ways when an empty message<br />    is given via -m '', all of which has been corrected.</p>    <p> * Support for CRAM-MD5 authentication method in "git imap-send" did<br />    not work well.</p>    <p> * Upcoming OpenSSL 1.1.0 will break compilation by updating a few API<br />    elements we use in imap-send, which has been adjusted for the change.</p>    <p> * The socks5:// proxy support added back in 2.6.4 days was not aware<br />    that socks5h:// proxies behave differently from socks5:// proxies.</p>    <p> * "git config" had a codepath that tried to pass a NULL to<br />    printf("%s"), which nobody seems to have noticed.</p>    <p> * On Cygwin, object creation uses the "create a temporary and then<br />    rename it to the final name" pattern, not "create a temporary,<br />    hardlink it to the final name and then unlink the temporary"<br />    pattern.</p>    <p>   This is necessary to use Git on Windows shared directories, and is<br />    already enabled for the MinGW and plain Windows builds.  It also<br />    has been used in Cygwin packaged versions of Git for quite a while.<br />    See http://thread.gmane.org/gmane.comp.version-control.git/291853</p>    <p> * "merge-octopus" strategy did not ensure that the index is clean<br />    when merge begins.</p>    <p> * When "git merge" notices that the merge can be resolved purely at<br />    the tree level (without having to merge blobs) and the resulting<br />    tree happens to already exist in the object store, it forgot to<br />    update the index, which left an inconsistent state that would<br />    break later operations.</p>    <p> * "git submodule" reports the paths of submodules the command<br />    recurses into, but these paths were incorrectly reported when<br />    the command was not run from the root level of the superproject.</p>    <p> * The "user.useConfigOnly" configuration variable makes it an error<br />    if users do not explicitly set user.name and user.email.  However,<br />    its check was not done early enough and allowed another error to<br />    trigger, reporting that the default value we guessed from the<br />    system setting was unusable.  This was a suboptimal end-user<br />    experience as we want the users to set user.name/user.email without<br />    relying on the auto-detection at all.</p>    <p> * "git mv old new" did not adjust the path for a submodule that lives<br />    as a subdirectory inside old/ directory correctly.</p>    <p> * "git replace -e" did not honour "core.editor" configuration.</p>    <p> * "git push" from a corrupt repository that attempts to push a large<br />    number of refs deadlocked; the thread to relay rejection notices<br />    for these ref updates blocked on writing them to the main thread,<br />    after the main thread at the receiving end notices that the push<br />    failed and decides not to read these notices and return a failure.</p>    <p> * mmap emulation on Windows has been optimized and work better without<br />    consuming paging store when not needed.</p>    <p> * A question by "git send-email" to ask the identity of the sender<br />    has been updated.</p>    <p> * UI consistency improvements for "git mergetool".</p>    <p> * "git rebase -m" could be asked to rebase an entire branch starting<br />    from the root, but failed by assuming that there always is a parent<br />    commit to the first commit on the branch.</p>    <p> * Fix a broken "p4 lfs" test.</p>    <p> * Recent update to Git LFS broke "git p4" by changing the output from<br />    its "lfs pointer" subcommand.</p>    <p> * "git fetch" test t5510 was flaky while running a (forced) automagic<br />    garbage collection.</p>    <p> * Documentation updates to help contributors setting up Travis CI<br />    test for their patches.</p>    <p> * Some multi-byte encoding can have a backslash byte as a later part<br />    of one letter, which would confuse "highlight" filter used in<br />    gitweb.</p>    <p> * "git commit-tree" plumbing command required the user to always sign<br />    its result when the user sets the commit.gpgsign configuration<br />    variable, which was an ancient mistake.  Rework "git rebase" that<br />    relied on this mistake so that it reads commit.gpgsign and pass (or<br />    not pass) the -S option to "git commit-tree" to keep the end-user<br />    expectation the same, while teaching "git commit-tree" to ignore<br />    the configuration variable.  This will stop requiring the users to<br />    sign commit objects used internally as an implementation detail of<br />    "git stash".</p>    <p> * "http.cookieFile" configuration variable clearly wants a pathname,<br />    but we forgot to treat it as such by e.g. applying tilde expansion.</p>    <p> * Consolidate description of tilde-expansion that is done to<br />    configuration variables that take pathname to a single place.</p>    <p> * Correct faulty recommendation to use "git submodule deinit ." when<br />    de-initialising all submodules, which would result in a strange<br />    error message in a pathological corner case.</p>    <p> * Many 'linkgit:<git documentation page>' references were broken,<br />    which are all fixed with this.</p>    <p> * "git rerere" can get confused by conflict markers deliberately left<br />    by the inner merge step, because they are indistinguishable from<br />    the real conflict markers left by the outermost merge which are<br />    what the end user and "rerere" need to look at.  This was fixed by<br />    making the conflict markers left by the inner merges a bit longer.<br />    (merge 0f9fd5c jc/ll-merge-internal later to maint).</p>    <p> * CI test was taught to build documentation pages.</p>    <p> * "git fsck" learned to catch NUL byte in a commit object as<br />    potential error and warn.</p>    <p> * Portability enhancement for "rebase -i" to help platforms whose<br />    shell does not like "for i in <empty>" (which is not POSIX-kosher).</p>    <p> * On Windows, .git and optionally any files whose name starts with a<br />    dot are now marked as hidden, with a core.hideDotFiles knob to<br />    customize this behaviour.</p>    <p> * Documentation for "git merge --verify-signatures" has been updated<br />    to clarify that the signature of only the commit at the tip is<br />    verified.  Also the phrasing used for signature and key validity is<br />    adjusted to align with that used by OpenPGP.</p>    <p> * A couple of bugs around core.autocrlf have been fixed.</p>    <p> * Many commands normalize command line arguments from NFD to NFC<br />    variant of UTF-8 on OSX, but commands in the "diff" family did<br />    not, causing "git diff $path" to complain that no such path is<br />    known to Git.  They have been taught to do the normalization.</p>    <p> * "git difftool" learned to handle unmerged paths correctly in<br />    dir-diff mode.</p>    <p> * The "are we talking with TTY, doing an interactive session?"<br />    detection has been updated to work better for "Git for Windows".</p>    <p> * We forgot to add "git log --decorate=auto" to documentation when we<br />    added the feature back in v2.1.0 timeframe.<br />    (merge 462cbb4 rj/log-decorate-auto later to maint).</p>    <p> * "git fast-import --export-marks" would overwrite the existing marks<br />    file even when it makes a dump from its custom die routine.<br />    Prevent it from doing so when we have an import-marks file but<br />    haven't finished reading it.<br />    (merge f4beed6 fc/fast-import-broken-marks-file later to maint).</p>    <p> * "git rebase -i", after it fails to auto-resolve the conflict, had<br />    an unnecessary call to "git rerere" from its very early days, which<br />    was spotted recently; the call has been removed.<br />    (merge 7063693 js/rebase-i-dedup-call-to-rerere later to maint).</p>    <p> * Other minor clean-ups and documentation updates<br />    (merge cd82b7a pa/cherry-pick-doc-typo later to maint).<br />    (merge 2bb73ae rs/patch-id-use-skip-prefix later to maint).<br />    (merge aa20cbc rs/apply-name-terminate later to maint).<br />    (merge fe17fc0 jc/t2300-setup later to maint).<br />    (merge e256eec jk/shell-portability later to maint).</p>    <h2>下载</h2>    <ul>     <li><a href="/misc/goto?guid=4958991351417295659" rel="nofollow"><strong>Source code</strong> (zip)</a></li>     <li><a href="/misc/goto?guid=4958991351514481844" rel="nofollow"><strong>Source code</strong> (tar.gz)</a></li>    </ul>