Skip to content

Commit ed13658

Browse files
committed
Add gitignore into the notes
1 parent eedb17e commit ed13658

2 files changed

Lines changed: 33 additions & 1 deletion

File tree

notes/01/02-the-basics.tex

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,36 @@ \subsection{File states}
4444

4545
\img{12cm}{resources/file-states.jpg}{1em}{The main states a file can be in according to Git}
4646

47+
\subsection{\texttt{.gitignore}}
48+
49+
The \texttt{.gitignore} file allows you to specify any files or directories you do not want tracked inside your project repo.
50+
\\
51+
52+
On complex projects this is invaluable.
53+
\\
54+
55+
It uses globbing patterns to match against file names. Examples are as follows:
56+
57+
58+
\begin{minted}{bash}
59+
60+
// By default, patterns match files in any directory
61+
Debug.log
62+
63+
// The * is a wildcard that matches zero or more characters
64+
*.log
65+
66+
// You can prepend a pattern with a double asterisk to match directories anywhere in the repository
67+
**.log
68+
69+
//Prepending a slash matches files only in the repository root
70+
/debug.log
71+
72+
\end{minted}
73+
74+
\href{https://linux.die.net/man/7/glob}{Globbing patterns}
75+
\href{https://www.atlassian.com/git/tutorials/saving-changes/gitignore}{Atlassian gitignore article}
76+
4777

4878
\section{Basic commands}
4979

@@ -257,5 +287,7 @@ \section{Additional resources}
257287
\item \href{https://github.com/alphagov/styleguides/blob/master/git.md}{GDS Git style guide}
258288
\item \href{https://chris.beams.io/posts/git-commit/}{How to write a good Git commit message}
259289
\item \href{https://thoughtbot.com/blog/5-useful-tips-for-a-better-commit-message}{5 tips for a better commit message}
290+
\item \href{https://linux.die.net/man/7/glob}{Globbing patterns}
291+
\item \href{https://www.atlassian.com/git/tutorials/saving-changes/gitignore}{Atlassian gitignore article}
260292
\end{itemize}
261293

notes/01/05-remote.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ \subsection{ \texttt{git pull} merge conflict}
287287

288288
* branch master -> FETCH_HEAD
289289

290-
Auto-merging README.md
290+
Auto-merging README.md
291291

292292
CONFLICT (add/add): Merge conflict in README.md
293293

0 commit comments

Comments
 (0)