use 'init' instead of 'init-db' for shipped docs and tools
While 'init-db' still is and probably will always remain a valid git command for obvious backward compatibility reasons, it would be a good idea to move shipped tools and docs to using 'init' instead. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
parent
120b0dfbed
commit
5c94f87e6b
@ -100,7 +100,7 @@ core.sharedRepository::
|
||||
group-writable). When 'all' (or 'world' or 'everybody'), the
|
||||
repository will be readable by all users, additionally to being
|
||||
group-shareable. When 'umask' (or 'false'), git will use permissions
|
||||
reported by umask(2). See gitlink:git-init-db[1]. False by default.
|
||||
reported by umask(2). See gitlink:git-init[1]. False by default.
|
||||
|
||||
core.warnAmbiguousRefs::
|
||||
If true, git will warn you if the ref name you passed it is ambiguous
|
||||
|
@ -46,12 +46,12 @@ to import into git.
|
||||
For our first example, we're going to start a totally new repository from
|
||||
scratch, with no pre-existing files, and we'll call it `git-tutorial`.
|
||||
To start up, create a subdirectory for it, change into that
|
||||
subdirectory, and initialize the git infrastructure with `git-init-db`:
|
||||
subdirectory, and initialize the git infrastructure with `git-init`:
|
||||
|
||||
------------------------------------------------
|
||||
$ mkdir git-tutorial
|
||||
$ cd git-tutorial
|
||||
$ git-init-db
|
||||
$ git-init
|
||||
------------------------------------------------
|
||||
|
||||
to which git will reply
|
||||
@ -1371,11 +1371,11 @@ $ mkdir my-git.git
|
||||
------------
|
||||
|
||||
Then, make that directory into a git repository by running
|
||||
`git init-db`, but this time, since its name is not the usual
|
||||
`git init`, but this time, since its name is not the usual
|
||||
`.git`, we do things slightly differently:
|
||||
|
||||
------------
|
||||
$ GIT_DIR=my-git.git git-init-db
|
||||
$ GIT_DIR=my-git.git git-init
|
||||
------------
|
||||
|
||||
Make sure this directory is available for others you want your
|
||||
@ -1511,7 +1511,7 @@ A recommended workflow for a "project lead" goes like this:
|
||||
+
|
||||
If other people are pulling from your repository over dumb
|
||||
transport protocols (HTTP), you need to keep this repository
|
||||
'dumb transport friendly'. After `git init-db`,
|
||||
'dumb transport friendly'. After `git init`,
|
||||
`$GIT_DIR/hooks/post-update` copied from the standard templates
|
||||
would contain a call to `git-update-server-info` but the
|
||||
`post-update` hook itself is disabled by default -- enable it
|
||||
|
@ -80,7 +80,7 @@ it:
|
||||
------------------------------------------------
|
||||
$ mkdir /pub/my-repo.git
|
||||
$ cd /pub/my-repo.git
|
||||
$ git --bare init-db --shared
|
||||
$ git --bare init --shared
|
||||
$ git --bare fetch /home/alice/myproject master:master
|
||||
------------------------------------------------
|
||||
|
||||
|
@ -79,9 +79,7 @@ was primarily meant to initialize the object database, but over
|
||||
time it has become responsible for setting up the other aspects
|
||||
of the repository, such as installing the default hooks and
|
||||
setting the configuration variables. The old name is retained
|
||||
because people are so used to it and many existing documents
|
||||
refer to it that way, and this will not change for some time to
|
||||
come.
|
||||
for backward compatibility reasons.
|
||||
|
||||
|
||||
EXAMPLES
|
||||
|
@ -93,7 +93,7 @@ perforce branch into a branch named "jammy", like so:
|
||||
------------
|
||||
$ mkdir -p /home/sean/import/jam
|
||||
$ cd /home/sean/import/jam
|
||||
$ git init-db
|
||||
$ git init
|
||||
$ git p4import //public/jam jammy
|
||||
------------
|
||||
|
||||
|
@ -171,7 +171,7 @@ OPTIONS
|
||||
--shared::
|
||||
--template=<template_directory>::
|
||||
Only used with the 'init' command.
|
||||
These are passed directly to gitlink:git-init-db[1].
|
||||
These are passed directly to gitlink:git-init[1].
|
||||
|
||||
-r <ARG>::
|
||||
--revision <ARG>::
|
||||
@ -367,7 +367,7 @@ Basic Examples
|
||||
Tracking and contributing to a the trunk of a Subversion-managed project:
|
||||
|
||||
------------------------------------------------------------------------
|
||||
# Initialize a repo (like git init-db):
|
||||
# Initialize a repo (like git init):
|
||||
git-svn init http://svn.foo.org/project/trunk
|
||||
# Fetch remote revisions:
|
||||
git-svn fetch
|
||||
@ -388,7 +388,7 @@ See also:
|
||||
'<<tracking-multiple-repos,Tracking Multiple Repositories or Branches>>'
|
||||
|
||||
------------------------------------------------------------------------
|
||||
# Initialize a repo (like git init-db):
|
||||
# Initialize a repo (like git init):
|
||||
git-svn multi-init http://svn.foo.org/project \
|
||||
-T trunk -b branches -t tags
|
||||
# Fetch remote revisions:
|
||||
|
@ -354,8 +354,7 @@ gitlink:git-index-pack[1]::
|
||||
Build pack idx file for an existing packed archive.
|
||||
|
||||
gitlink:git-init[1]::
|
||||
gitlink:git-init-db[1]::
|
||||
Creates an empty git object database, or reinitialize an
|
||||
Creates an empty git repository, or reinitialize an
|
||||
existing one.
|
||||
|
||||
gitlink:git-merge-file[1]::
|
||||
|
@ -3,7 +3,7 @@ Hooks used by git
|
||||
|
||||
Hooks are little scripts you can place in `$GIT_DIR/hooks`
|
||||
directory to trigger action at certain points. When
|
||||
`git-init-db` is run, a handful example hooks are copied in the
|
||||
`git-init` is run, a handful example hooks are copied in the
|
||||
`hooks` directory of the new repository, but by default they are
|
||||
all disabled. To enable a hook, make it executable with `chmod +x`.
|
||||
|
||||
|
@ -70,7 +70,7 @@ DocumentRoot /where/ever/httpd.conf" to find your root:
|
||||
Initialize a bare repository
|
||||
|
||||
$ cd my-new-repo.git
|
||||
$ git --bare init-db
|
||||
$ git --bare init
|
||||
|
||||
|
||||
Change the ownership to your web-server's credentials. Use "grep ^User
|
||||
|
@ -102,7 +102,7 @@ branches::
|
||||
hooks::
|
||||
Hooks are customization scripts used by various git
|
||||
commands. A handful of sample hooks are installed when
|
||||
`git init-db` is run, but all of them are disabled by
|
||||
`git init` is run, but all of them are disabled by
|
||||
default. To enable, they need to be made executable.
|
||||
Read link:hooks.html[hooks] for more details about
|
||||
each hook.
|
||||
|
2
INSTALL
2
INSTALL
@ -95,7 +95,7 @@ Issues of note:
|
||||
repository itself. For example, you could:
|
||||
|
||||
$ mkdir manual && cd manual
|
||||
$ git init-db
|
||||
$ git init
|
||||
$ git fetch-pack git://git.kernel.org/pub/scm/git/git.git man html |
|
||||
while read a b
|
||||
do
|
||||
|
@ -56,7 +56,7 @@ static void copy_templates_1(char *path, int baselen,
|
||||
|
||||
/* Note: if ".git/hooks" file exists in the repository being
|
||||
* re-initialized, /etc/core-git/templates/hooks/update would
|
||||
* cause git-init-db to fail here. I think this is sane but
|
||||
* cause git-init to fail here. I think this is sane but
|
||||
* it means that the set of templates we ship by default, along
|
||||
* with the way the namespace under .git/ is organized, should
|
||||
* be really carefully chosen.
|
||||
|
@ -22,7 +22,7 @@ commit
|
||||
diff
|
||||
fetch
|
||||
grep
|
||||
init-db
|
||||
init
|
||||
log
|
||||
merge
|
||||
mv
|
||||
|
@ -226,7 +226,7 @@ my $import = 0;
|
||||
unless (-d $git_dir) { # initial import
|
||||
if ($psets[0]{type} eq 'i' || $psets[0]{type} eq 't') {
|
||||
print "Starting import from $psets[0]{id}\n";
|
||||
`git-init-db`;
|
||||
`git-init`;
|
||||
die $! if $?;
|
||||
$import = 1;
|
||||
} else {
|
||||
|
@ -214,7 +214,7 @@ yes)
|
||||
GIT_DIR="$D" ;;
|
||||
*)
|
||||
GIT_DIR="$D/.git" ;;
|
||||
esac && export GIT_DIR && git-init-db ${template+"$template"} || usage
|
||||
esac && export GIT_DIR && git-init ${template+"$template"} || usage
|
||||
|
||||
if test -n "$reference"
|
||||
then
|
||||
|
@ -520,7 +520,7 @@ $orig_git_index = $ENV{GIT_INDEX_FILE} if exists $ENV{GIT_INDEX_FILE};
|
||||
my %index; # holds filenames of one index per branch
|
||||
|
||||
unless (-d $git_dir) {
|
||||
system("git-init-db");
|
||||
system("git-init");
|
||||
die "Cannot init the GIT db at $git_tree: $?\n" if $?;
|
||||
system("git-read-tree");
|
||||
die "Cannot init an empty tree: $?\n" if $?;
|
||||
@ -660,7 +660,7 @@ $ignorebranch{'#CVSPS_NO_BRANCH'} = 1;
|
||||
sub commit {
|
||||
if ($branch eq $opt_o && !$index{branch} && !get_headref($branch, $git_dir)) {
|
||||
# looks like an initial commit
|
||||
# use the index primed by git-init-db
|
||||
# use the index primed by git-init
|
||||
$ENV{GIT_INDEX_FILE} = '.git/index';
|
||||
$index{$branch} = '.git/index';
|
||||
} else {
|
||||
|
@ -163,7 +163,7 @@ class git_command:
|
||||
self.gitdir = self.get_single("rev-parse --git-dir")
|
||||
report(2, "gdir:", self.gitdir)
|
||||
except:
|
||||
die("Not a git repository... did you forget to \"git init-db\" ?")
|
||||
die("Not a git repository... did you forget to \"git init\" ?")
|
||||
try:
|
||||
self.cdup = self.get_single("rev-parse --show-cdup")
|
||||
if self.cdup != "":
|
||||
|
@ -286,7 +286,7 @@ sub init {
|
||||
|
||||
$SVN_URL = $url;
|
||||
unless (-d $GIT_DIR) {
|
||||
my @init_db = ('init-db');
|
||||
my @init_db = ('init');
|
||||
push @init_db, "--template=$_template" if defined $_template;
|
||||
push @init_db, "--shared" if defined $_shared;
|
||||
command_noisy(@init_db);
|
||||
|
@ -285,7 +285,7 @@ my $last_rev = "";
|
||||
my $last_branch;
|
||||
my $current_rev = $opt_s || 1;
|
||||
unless(-d $git_dir) {
|
||||
system("git-init-db");
|
||||
system("git-init");
|
||||
die "Cannot init the GIT db at $git_tree: $?\n" if $?;
|
||||
system("git-read-tree");
|
||||
die "Cannot init an empty tree: $?\n" if $?;
|
||||
|
@ -63,7 +63,7 @@ for doing easily operations which are not totally trivial to do over
|
||||
the generic command interface.
|
||||
|
||||
While some commands can be executed outside of any context (e.g. 'version'
|
||||
or 'init-db'), most operations require a repository context, which in practice
|
||||
or 'init'), most operations require a repository context, which in practice
|
||||
means getting an instance of the Git object using the repository() constructor.
|
||||
(In the future, we will also get a new_repository() constructor.) All commands
|
||||
called as methods of the object are then executed in the context of the
|
||||
|
2
t/README
2
t/README
@ -18,7 +18,7 @@ The easiest way to run tests is to say "make". This runs all
|
||||
the tests.
|
||||
|
||||
*** t0000-basic.sh ***
|
||||
* ok 1: .git/objects should be empty after git-init-db in an empty repo.
|
||||
* ok 1: .git/objects should be empty after git-init in an empty repo.
|
||||
* ok 2: .git/objects should have 256 subdirectories.
|
||||
* ok 3: git-update-index without --add should fail adding.
|
||||
...
|
||||
|
@ -31,12 +31,12 @@ fi
|
||||
. ./test-lib.sh
|
||||
|
||||
################################################################
|
||||
# init-db has been done in an empty repository.
|
||||
# git-init has been done in an empty repository.
|
||||
# make sure it is empty.
|
||||
|
||||
find .git/objects -type f -print >should-be-empty
|
||||
test_expect_success \
|
||||
'.git/objects should be empty after git-init-db in an empty repo.' \
|
||||
'.git/objects should be empty after git-init in an empty repo.' \
|
||||
'cmp -s /dev/null should-be-empty'
|
||||
|
||||
# also it should have 2 subdirectories; no fan-out anymore, pack, and info.
|
||||
|
@ -50,12 +50,12 @@ test_expect_success 'setup separate repository lacking postimage' '
|
||||
|
||||
git tar-tree initial initial | tar xf - &&
|
||||
(
|
||||
cd initial && git init-db && git add .
|
||||
cd initial && git init && git add .
|
||||
) &&
|
||||
|
||||
git tar-tree second second | tar xf - &&
|
||||
(
|
||||
cd second && git init-db && git add .
|
||||
cd second && git init && git add .
|
||||
)
|
||||
|
||||
'
|
||||
|
@ -44,7 +44,7 @@ test_expect_success \
|
||||
'unpack without delta' \
|
||||
"GIT_OBJECT_DIRECTORY=.git2/objects &&
|
||||
export GIT_OBJECT_DIRECTORY &&
|
||||
git-init-db &&
|
||||
git-init &&
|
||||
git-unpack-objects -n <test-1-${packname_1}.pack &&
|
||||
git-unpack-objects <test-1-${packname_1}.pack"
|
||||
|
||||
@ -75,7 +75,7 @@ test_expect_success \
|
||||
'unpack with delta' \
|
||||
'GIT_OBJECT_DIRECTORY=.git2/objects &&
|
||||
export GIT_OBJECT_DIRECTORY &&
|
||||
git-init-db &&
|
||||
git-init &&
|
||||
git-unpack-objects -n <test-2-${packname_2}.pack &&
|
||||
git-unpack-objects <test-2-${packname_2}.pack'
|
||||
|
||||
@ -100,7 +100,7 @@ test_expect_success \
|
||||
'use packed objects' \
|
||||
'GIT_OBJECT_DIRECTORY=.git2/objects &&
|
||||
export GIT_OBJECT_DIRECTORY &&
|
||||
git-init-db &&
|
||||
git-init &&
|
||||
cp test-1-${packname_1}.pack test-1-${packname_1}.idx .git2/objects/pack && {
|
||||
git-diff-tree --root -p $commit &&
|
||||
while read object
|
||||
|
@ -97,7 +97,7 @@ pull_to_client () {
|
||||
(
|
||||
mkdir client &&
|
||||
cd client &&
|
||||
git-init-db 2>> log2.txt
|
||||
git-init 2>> log2.txt
|
||||
)
|
||||
|
||||
add A1
|
||||
|
@ -73,7 +73,7 @@ test_expect_success 'fetch following tags' '
|
||||
|
||||
mkdir four &&
|
||||
cd four &&
|
||||
git init-db &&
|
||||
git init &&
|
||||
|
||||
git fetch .. :track &&
|
||||
git show-ref --verify refs/tags/anno &&
|
||||
|
@ -17,7 +17,7 @@ test_expect_success setup '
|
||||
test_expect_success 'pulling into void' '
|
||||
mkdir cloned &&
|
||||
cd cloned &&
|
||||
git init-db &&
|
||||
git init &&
|
||||
git pull ..
|
||||
'
|
||||
|
||||
|
@ -88,7 +88,7 @@ test_expect_success \
|
||||
|
||||
test_expect_success "Michael Cassar's test case" '
|
||||
rm -fr .git papers partA &&
|
||||
git init-db &&
|
||||
git init &&
|
||||
mkdir -p papers/unsorted papers/all-papers partA &&
|
||||
echo a > papers/unsorted/Thesis.pdf &&
|
||||
echo b > partA/outline.txt &&
|
||||
@ -109,7 +109,7 @@ rm -fr papers partA path?
|
||||
|
||||
test_expect_success "Sergey Vlasov's test case" '
|
||||
rm -fr .git &&
|
||||
git init-db &&
|
||||
git init &&
|
||||
mkdir ab &&
|
||||
date >ab.c &&
|
||||
date >ab/d &&
|
||||
|
@ -220,8 +220,8 @@ test_create_repo () {
|
||||
repo="$1"
|
||||
mkdir "$repo"
|
||||
cd "$repo" || error "Cannot setup test environment"
|
||||
"$GIT_EXEC_PATH/git" init-db --template=$GIT_EXEC_PATH/templates/blt/ >/dev/null 2>&1 ||
|
||||
error "cannot run git init-db -- have you built things yet?"
|
||||
"$GIT_EXEC_PATH/git" init --template=$GIT_EXEC_PATH/templates/blt/ >/dev/null 2>&1 ||
|
||||
error "cannot run git init -- have you built things yet?"
|
||||
mv .git/hooks .git/hooks-disabled
|
||||
cd "$owd"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user