Compare commits

...

15 Commits

1 changed files with 121 additions and 50 deletions

View File

@ -13,20 +13,24 @@
% содержание и нумерация
\setcounter{tocdepth}{4} % table of contents depth
\setcounter{secnumdepth}{4} % numbering depth
% Fix PDF's cross-reference jumps
\restylefloat{table}
\restylefloat{figure}
\end_preamble
\use_default_options true
\begin_modules
customHeadersFooters
enumitem
fixltx2e
fix-cm
braille
enumitem
fix-cm
initials
figs-within-sections
tabs-within-sections
eqs-within-sections
endnotes
foottoend
logicalmkup
hanging
\end_modules
\maintain_unincluded_children false
\language russian
@ -48,20 +52,21 @@ foottoend
\output_sync 0
\bibtex_command default
\index_command default
\float_placement H
\paperfontsize default
\spacing single
\use_hyperref true
\pdf_title "Git-tutorial"
\pdf_author "Kolan Sh, InSys Ltd, Moscow"
\pdf_subject "Git"
\pdf_keywords "tex,lyx,latex,texreport,texparser"
\pdf_keywords "git,tutorial"
\pdf_bookmarks true
\pdf_bookmarksnumbered false
\pdf_bookmarksopen false
\pdf_bookmarksopenlevel 1
\pdf_bookmarksnumbered true
\pdf_bookmarksopen true
\pdf_bookmarksopenlevel 3
\pdf_breaklinks false
\pdf_pdfborder false
\pdf_colorlinks false
\pdf_pdfborder true
\pdf_colorlinks true
\pdf_backref false
\pdf_pdfusetitle true
\papersize default
@ -89,18 +94,18 @@ foottoend
\shortcut idx
\color #008000
\end_index
\leftmargin 2cm
\leftmargin 1.5cm
\topmargin 1.5cm
\rightmargin 1cm
\bottommargin 2cm
\secnumdepth 3
\tocdepth 3
\secnumdepth 5
\tocdepth 5
\paragraph_separation indent
\paragraph_indentation default
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\paperpagestyle fancy
\tracking_changes false
\output_changes false
\html_math_output 0
@ -110,26 +115,6 @@ foottoend
\begin_body
\begin_layout Title
Краткое введение в Git
\end_layout
\begin_layout Author
Working horsy
\begin_inset Newline newline
\end_inset
InSys Ltd, Moscow
\end_layout
\begin_layout Date
February 27, 2013
\end_layout
\begin_layout Date
Версия 1.3.2
\end_layout
\begin_layout Standard
\begin_inset ERT
status open
@ -138,7 +123,27 @@ status open
\backslash
thispagestyle{empty}
title{Краткое введение в Git}
\end_layout
\begin_layout Plain Layout
\backslash
author{Колян Ш.
\backslash
\backslash
\backslash
normalsize Версия 1.3.5}
\end_layout
\begin_layout Plain Layout
\backslash
maketitle
\end_layout
\end_inset
@ -147,25 +152,17 @@ thispagestyle{empty}
\end_layout
\begin_layout Standard
\lang english
\begin_inset Newpage newpage
\end_inset
\end_layout
\begin_layout Standard
\lang english
\begin_inset CommandInset toc
LatexCommand tableofcontents
\end_inset
\lang russian
\end_layout
\begin_layout Standard
\lang english
\begin_inset Newpage newpage
\end_inset
@ -2750,7 +2747,7 @@ git diff-tree -p mylib_remote/master # сравнить с удалённой в
\end_layout
\begin_layout LyX-Code
git clean # удалить неотслеживаемые файлы в репозитории
git clean -fd # удалить неотслеживаемые файлы в репозитории
\end_layout
\begin_layout LyX-Code
@ -2758,8 +2755,82 @@ git prune # удалить все недостижимые объекты/ком
\end_layout
\begin_layout LyX-Code
git gc --aggressive --prune # удалить все бесполезные объекты и оптимизировать
локальный репозиторий
git prune-packed # удалить также уже упакованные недостижимые объекты
\end_layout
\begin_layout LyX-Code
git gc --aggressive --prune=all # удалить все бесполезные объекты и оптимизирова
ть локальный репозиторий
\end_layout
\begin_layout Subsection
shallow-репозиторий
\end_layout
\begin_layout Standard
Это такой репозиторий, который хранит лишь часть истории, что позволяет
сэкономить место на диске и входящий трафик при его создании, но запрещает
клонирование и другие операции с ним.
\end_layout
\begin_layout Standard
Для создания shallow-репозитория можно выполнить клонирование обычного с
опцией --depth, например:
\end_layout
\begin_layout LyX-Code
git clone --depth=1 git://github.com/gentoo-mirror/gentoo.git /var/portage/portage
\end_layout
\begin_layout Standard
Для создания shallow-репозитория
\begin_inset Quotes eld
\end_inset
на месте
\begin_inset Quotes erd
\end_inset
(
\begin_inset Quotes eld
\end_inset
inplace
\begin_inset Quotes erd
\end_inset
) без клонирования и передачи данных по сети подходит следующий вариант
(взято со
\begin_inset CommandInset href
LatexCommand href
name "stackoverflow"
target "http://stackoverflow.com/a/7937916/5218714"
\end_inset
):
\end_layout
\begin_layout LyX-Code
git show-ref -s HEAD > .git/shallow
\end_layout
\begin_layout LyX-Code
git reflog expire --expire=0
\end_layout
\begin_layout LyX-Code
git prune
\end_layout
\begin_layout LyX-Code
git prune-packed
\end_layout
\begin_layout Standard
Последняя последовательность команд совместно с git gc --aggressive --prune=all
может быть использована для периодической чистки shallow-репозитория от
старой истории.
\end_layout
\begin_layout Subsection