亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

目錄 搜尋
Guides gitattributes giteveryday gitglossary gitignore gitmodules gitrevisions gittutorial gitworkflows Administration git archive git bundle git clean git filter-branch git fsck git gc git instaweb git reflog Basic Snapshotting git add git commit git diff git mv git reset git rm git status Branching and Merging git branch git checkout git log git merge git mergetool git stash git tag Debugging git bisect git blame git grep Email git am git format-patch git request-pull git send-email External Systems git fast-import git svn Getting and Creating Projects git clone git init Git git annotate git archimport git bisect-lk2009 git check-attr git check-mailmap git check-ref-format git checkout-index git cherry git citool git column git credential git credential-cache git credential-store git cvsexportcommit git cvsimport git cvsserver git diff-files git diff-tree git difftool git fast-export git fetch-pack git fmt-merge-msg git get-tar-commit-id git gui git http-backend git http-fetch git http-push git imap-send git index-pack git interpret-trailers git ls-remote git ls-tree git mailinfo git mailsplit git merge-file git merge-index git merge-one-file git merge-tree git mktag git mktree git name-rev git notes git p4 git pack-objects git pack-redundant git pack-refs git parse-remote git patch-id git prune git prune-packed git quiltimport git receive-pack git remote-ext git remote-fd git remote-testgit git repack git replace git rerere git send-pack git sh-i18n git sh-setup git shell git show-branch git show-index git stripspace git unpack-file git unpack-objects git upload-archive git upload-pack git var git verify-commit git verify-tag git whatchanged git worktree Inspection and Comparison git describe git shortlog git show Miscellaneous api credentials api index gitcli gitcore tutorial gitcredentials gitcvs migration gitdiffcore githooks gitk gitnamespaces gitremote helpers gitrepository layout gitsubmodules gittutorial 2 gitweb gitweb.conf pack format User Manual Patching git apply git cherry-pick git rebase git revert Plumbing Commands git cat-file git check-ignore git commit-tree git count-objects git diff-index git for-each-ref git hash-object git ls-files git merge-base git read-tree git rev-list git rev-parse git show-ref git symbolic-ref git update-index git update-ref git verify-pack git write-tree Server Admin git daemon git update-server-info Setup and Config git git config git help Sharing and Updating Projects git fetch git pull git push git remote git submodule
文字

名稱

git-init  - 創(chuàng)建一個空的 Git 倉庫或重新初始化一個現(xiàn)有倉庫

概要

git init [-q | --quiet] [--bare] [--template=<template_directory>]          [--separate-git-dir <git dir>]          [--shared[=<permissions>]] [directory]

描述

此命令創(chuàng)建一個空的 Git 倉庫-基本上是一個.git與子目錄的目錄objects,refs/headsrefs/tags,和模板文件。HEAD還創(chuàng)建了引用主分支的 HEAD 的初始文件。

如果$GIT_DIR設置了環(huán)境變量,那么它將指定一個要使用的路徑,而不是./.git存儲庫的基礎。

如果通過$GIT_OBJECT_DIRECTORY環(huán)境變量指定了對象存儲目錄,則在下面創(chuàng)建sha1目錄 - 否則使用默認$GIT_DIR/objects目錄。

在現(xiàn)有的存儲庫中運行是git init安全的。它不會覆蓋已經(jīng)存在的東西。重新運行git init的主要原因是拾取新添加的模板(或者如果給出--separate-git-dir,則將存儲庫移動到另一個位置)。

選項

-q   --quiet

僅打印錯誤和警告消息;所有其他輸出將被抑制。

--bare

創(chuàng)建一個裸倉庫。如果GIT_DIR未設置環(huán)境,則將其設置為當前工作目錄。

--template=<template_directory>

指定將使用模板的目錄。(請參閱下面的“模板目錄”部分。)

--separate-git-dir=<git dir>

相反,初始化存儲庫作為目錄之一$GIT_DIR或者./.git/,創(chuàng)建一個包含路徑的實際存儲庫的文本文件存在。該文件充當文件系統(tǒng)不可知的 Git 與存儲庫的符號鏈接。

如果這是重新初始化,存儲庫將被移動到指定的路徑。

--shared=(false|true|umask|group|all|world|everybody|0xxx)

指定 Git 存儲庫將在多個用戶之間共享。這允許屬于同一組的用戶推入該存儲庫。指定時,將設置配置變量“core.sharedRepository”,以便$GIT_DIR使用請求的權限創(chuàng)建下面的文件和目錄。未指定時,Git 將使用 umask(2)報告的權限。

該選項可以具有以下值,如果group沒有給定的值,則默認為:

umask (or false)

使用由 umask(2)報告的權限。--shared未指定時的默認值。

group (or true)

使存儲庫組可寫,(和g + sx,因為 git 組可能不是所有用戶的主要組)。這用于放寬其他安全的 umask(2)值的權限。請注意,umask 仍然適用于其他權限位(例如,如果 umask 是0022,使用group不會從其他(非組)用戶刪除讀取權限)。請參閱0xxx如何準確指定存儲庫權限。

all (or world or everybody)

與此相同group,但使存儲庫可供所有用戶閱讀。

0xxx

0xxx是一個八進制數(shù),每個文件都有模式0xxx。0xxx將覆蓋用戶的 umask(2)的值(不僅是松開的權限groupall一樣)。0640將創(chuàng)建一個群組可讀的存儲庫,但不能對其他群組進行寫入或訪問。0660將創(chuàng)建一個對當前用戶和組可讀可寫的回購,但其他人無法訪問。

默認情況下,配置標志receive.denyNonFastForwards在共享存儲庫中啟用,以便您不能強制進行非快速轉發(fā)。

如果你提供了一個directory,那么這個命令就在里面運行。如果這個目錄不存在,它將被創(chuàng)建。

模板目錄

模板目錄中名稱不以點開頭的文件和目錄將$GIT_DIR在其創(chuàng)建后復制到其中。

模板目錄將是以下內容之一(按順序):

  • --template選項一起提供的論據(jù);

  • $GIT_TEMPLATE_DIR環(huán)境變量的內容;

  • 所述init.templateDir配置變量;要么

  • 默認模板目錄:/usr/share/git-core/templates。

默認模板目錄包含一些目錄結構,建議使用“排除模式”(參見 gitignore [5])和示例鉤子文件。

示例鉤子默認情況下都是禁用的,要啟用其中一個示例鉤子,可以通過刪除其.sample后綴來對其進行重命名。

有關鉤子執(zhí)行的更多信息,請參閱 githooks [5]。

示例

為現(xiàn)有的代碼庫啟動一個新的 Git 存儲庫

$ cd /path/to/my/codebase
$ git init      (1)$ git add .     (2)$ git commit    (3)

1. 創(chuàng)建一個/path/to/my/codebase/.git目錄。

2. 將所有現(xiàn)有文件添加到索引。

3. 將原始狀態(tài)記錄為歷史記錄中的第一個提交。

上一篇: 下一篇: