-
Notifications
You must be signed in to change notification settings - Fork 194
/
figure-legends.tex
48 lines (38 loc) · 4.07 KB
/
figure-legends.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
\section*{Figure Legends}
\textbf{Figure \ref{fig:Fig1}. The git add/commit process.}
To store a snapshot of changes in your repository, first \verb|git add| any files to the staging area you wish to commit (for example, you've updated the \verb|process.sh| file).
Second, type \verb|git commit| with a message. Only files added to the staging area will be committed.
All past commits are located in the hidden \verb|.git| directory in your repository.
\textbf{Figure \ref{fig:Fig2}. Working with a local repository.}
A) To designate a directory on your computer as a Git repo, type the command \verb|git init|.
This initializes the repository and will allow you to track the files located within that directory.
B) Once you have added a file, follow the git add/commit cycle to place the new file first into the staging area by typing \verb|git add| to designate it to be committed, and then \verb|git commit| to take the shapshot of that file.
The commit is assigned a commit identifier (d75es) that can be used in the future to pull up this version or to compare different committed versions of this file.
C) As you continue to add and change files, you should regularly add and commit those changes.
Here, an additional commit was done and the commit log now shows two commit identifiers: d75es (from step B) and f658t (the new commit).
Each commit will generate a unique identifier, which can be examined in reverse chronological order using \verb|git log|.
\textbf{Figure \ref{fig:Fig3}. Working with both a local and remote repository as a single user.}
A) On your computer you commit to a Git repository (commit d75es).
B) On GitHub, you create a new repository called \verb|thesis|.
This repository is currently empty and not linked to the repo on your local machine.
C) The command \verb|git remote add| connects your local repository to your remote repository.
The remote repository is still empty, however, because you have not pushed any content to it.
D) You send all the local commits to the remote repository using the command \verb|git push|.
Only files that have been committed will appear in the remote repository.
E) You repeat several more rounds of updating scripts and committing on your local computer (commit f658t and then commit xv871).
You have not yet pushed these commits to the remote repository, so only the previously pushed commit is in the remote repo (commit d75es).
F) To bring the remote repository up-to-date with your local repository, you \verb|git push| the two new commits to the remote repository.
The local and remote repositories now contain the same files and commit histories.
\textbf{Figure \ref{fig:Fig4}. Contributing to Open Source Projects.}
We would like you to add an empty file that is named after your GitHub username to the repo used to write this manuscript.
A) Using your internet browser, navigate to \href{https://github.com/jdblischak/git-for-science}{github.com/jdblischak/git-for-science}.
B) Click on the ``Fork'' button to create a copy of this repo on GitHub under your username.
C) On your computer, type \verb|git clone https://github.com/username/git-for-science.git|, which will create a copy of git-for-science on your local machine.
D) Navigate to the \verb|readers| directory by typing \verb|cd git-for-science/readers/|.
Create an empty file that is titled with your GitHub username by typing \verb|touch username.txt|.
Commit that new file by adding it to the staging area (\verb|git add username.txt|) and committing with a message (\verb|git commit -m "Add username to directory of readers."|).
Note that your commit identifier will be different than what is shown here.
E) You have committed your new file locally and the next step is to push that new commit up to the git-for-science repo under your username on GitHub.
To do so, type \verb|git push origin master|.
F) To request to add your commits to the original git-for-science repo, issue a pull request from the git-for-science repo under your username on GitHub.
Once your Pull Request is reviewed and accepted, you will be able to see the file you committed with your username in the original git-for-science repository.