Compare commits

...

21 Commits

Author SHA1 Message Date
Kolan Sh b4381b4219 Merge branch 'release-1.3.5' 2015-08-12 21:01:26 +03:00
Kolan Sh b4c0f9de57 Bumped version number to 1.3.5 2015-08-12 21:01:12 +03:00
Kolan Sh 84796b5ce4 Fix git gc --prune=all command. 2015-08-12 21:00:19 +03:00
Kolan Sh 47329079d9 Merge branch 'release-1.3.4' 2015-08-12 13:16:32 +03:00
Kolan Sh 53a90d917f Merge branch 'release-1.3.4' into develop 2015-08-12 13:16:29 +03:00
Kolan Sh 64cd135bd2 Bumped version number to 1.3.4 2015-08-12 13:16:20 +03:00
Kolan Sh 5437ff5e4d Administration: git shallow. 2015-08-12 13:12:39 +03:00
Kolan Sh fe1da207e2 PDF keywords fixed. 2014-11-05 17:22:19 +03:00
Kolan Sh 08aa39e00c Merge branch 'release-1.3.3' 2014-11-05 16:50:55 +03:00
Kolan Sh 17b442ed8a Merge branch 'release-1.3.3' into develop 2014-11-05 16:50:51 +03:00
Kolan Sh 3ce358272e Bumped version number to 1.3.3 2014-11-05 16:50:44 +03:00
Kolan Sh f896596f6f Many fixes to the page style, table of contents, document title. 2014-11-05 16:33:08 +03:00
Kolan Sh e9e3cb2237 Fancy Paper Page Styles. 2014-11-05 15:25:38 +03:00
Kolan Sh 50f84d0319 Don't include fixltx2e package as it brokes floats compilation. 2014-11-05 15:14:51 +03:00
Kolan Sh 2eeb374a69 Merge branch 'release-1.3.2' 2014-10-22 14:09:16 +04:00
Kolan Sh 45c67d168a Merge branch 'release-1.3.2' into develop 2014-10-22 14:09:12 +04:00
Kolan Sh 53afcb14bf Bumped version number to 1.3.2 2014-10-22 14:09:07 +04:00
Kolan Sh 3593bf88b6 Merge branch '#651_remote_commands' into develop 2014-10-22 14:07:46 +04:00
Kolan Sh 05f6c48a1e Closes #651: Describe Git Remote commands
such as update-ref refs/heads/master
573f6 or push origin :refs/tags/12345.
2014-10-22 14:07:19 +04:00
Kolan Sh 98fd3cb98e Closes #646: Describe git fsck --dangling. 2014-10-22 13:38:19 +04:00
Kolan Sh 3643e8d7c0 Merge branch 'release-1.3.1' into develop 2014-09-01 12:05:42 +04:00
1 changed files with 244 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.1
\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
@ -2149,6 +2146,56 @@ git rebase --continue # продолжить перепостроение ист
коммита
\end_layout
\begin_layout Subsubsection
Удаление тега в репозитории на сервере
\end_layout
\begin_layout Standard
Следующая команда удалит тег v0.1.2 на сервере:
\end_layout
\begin_layout LyX-Code
git push origin :refs/tags/v0.1.2
\end_layout
\begin_layout Standard
Следует не забыть также удалить тег локально:
\end_layout
\begin_layout LyX-Code
git tag -d v0.1.2
\end_layout
\begin_layout Standard
Иначе - при следующей отправки изменений он также попадёт на сервер.
\end_layout
\begin_layout Subsubsection
Обновление указателя головы ветки на сервере без локальных изменений
\end_layout
\begin_layout Standard
Следующая команда обновит указатель головы на сервере:
\end_layout
\begin_layout LyX-Code
git update-ref refs/heads/master 573f69d
\end_layout
\begin_layout Standard
Теперь голова ветки
\begin_inset Quotes eld
\end_inset
master
\begin_inset Quotes erd
\end_inset
в репозитории на сервере будет указывать на коммит с хешем 573f69d.
Это бывает полезно, когда хочется поработать над частью локальных коммитов,
отправляя невсе их сразу на сервер, а частями.
\end_layout
\begin_layout Subsubsection
Синхронизация веток
\end_layout
@ -2700,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
@ -2708,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
@ -2829,6 +2950,79 @@ git fsck --lost-found # с большой долей вероятности из
ревизии
\end_layout
\begin_layout Standard
\begin_inset space ~
\end_inset
\end_layout
\begin_layout Standard
Бывает также, что пользователь отключил
\begin_inset Quotes eld
\end_inset
reflog
\begin_inset Quotes erd
\end_inset
в настройках Git по ошибке или по неопределённым личным обстоятельствам.
В таких случаях может буквально спасти опция
\begin_inset Quotes eld
\end_inset
--dangling
\begin_inset Quotes erd
\end_inset
у
\begin_inset Quotes eld
\end_inset
git fsck
\begin_inset Quotes erd
\end_inset
:
\end_layout
\begin_layout LyX-Code
$ git fsck --dangling
\end_layout
\begin_layout LyX-Code
Checking object directories: 100% (256/256), done.
\end_layout
\begin_layout LyX-Code
Checking objects: 100% (84/84), done.
\end_layout
\begin_layout LyX-Code
dangling blob cd0120b458d5ab07efed5bb690b0eec8c1801b55
\end_layout
\begin_layout Standard
\begin_inset space ~
\end_inset
\end_layout
\begin_layout Standard
В конце выхлопа команды указаны хеши некогда существующих объектов, которые
никогда не использовались (не добавлялись в репозиторий).
Для восстановления требуемых объектов используется та же команда Git
\begin_inset Quotes eld
\end_inset
checkout
\begin_inset Quotes erd
\end_inset
.
\end_layout
\begin_layout Section
Удачная модель ветвления
\end_layout