|
14 | 14 | \floatRowSep%
|
15 | 15 | %
|
16 | 16 | \subfloat[][%
|
17 |
| -We click on the button for copying the URL to the clipboard.% |
| 17 | +We click on the button for copying the \pgls{URL} to the clipboard.% |
18 | 18 | \label{fig:gitClonePycharm02copyUrl}%
|
19 | 19 | ]{\tightbox{\includegraphics[width=0.48\linewidth]{\currentDir/gitClonePycharm02copyUrl}}}%
|
20 | 20 | %
|
21 | 21 | \floatSep%
|
22 | 22 | %
|
23 | 23 | \subfloat[][%
|
24 |
| -Now the URL is copied to the clipboard and we can paste it wherever we like via~\keys{\ctrl+V}.% |
| 24 | +Now the \pgls{URL} is copied to the clipboard and we can paste it wherever we like via~\keys{\ctrl+V}.% |
25 | 25 | \label{fig:gitClonePycharm03copiedUrl}%
|
26 | 26 | ]{\tightbox{\includegraphics[width=0.48\linewidth]{\currentDir/gitClonePycharm03copiedUrl}}}%
|
27 | 27 | %
|
|
55 | 55 | \floatSep%
|
56 | 56 | %
|
57 | 57 | \subfloat[][%
|
58 |
| -Normally, we would write the URL of the repository that we want to clone into the \menu{URL:} field. % |
59 |
| -Here, we paste the repository URL that we copied from the \github\ page with \keys{\ctrl + V}. % |
| 58 | +Normally, we would write the \pgls{URL} of the repository that we want to clone into the \menu{URL:} field. % |
| 59 | +Here, we paste the repository \pgls{URL} that we copied from the \github\ page with \keys{\ctrl + V}. % |
60 | 60 | We also enter a directory where the repository should be copied to into the \menu{Directory:} field. %
|
61 | 61 | Here, I simply selected a folder on my \linux\ temporary files partition (because I will delete the project once I am done with this example). %
|
62 | 62 | You would instead choose a more appropriate location. %
|
|
263 | 263 |
|
264 | 264 | As usual, we work through a topic based on an example.
|
265 | 265 | This time, our goal is to \emph{download and get to run code from a \github\ repository in \pycharm.}
|
266 |
| -As example repository, we pick the companion code of our \citetitle{databases} book~\cite{databases} at \url{\databasesCodeRepo}. |
| 266 | +Matter of fact, we already exercised the whole process of cloning the \github\ repository in \pycharm\ with the examples of this book in \cref{sec:gettingExamples}. |
| 267 | +To complement the excursion from back then, we this time pick the companion code of our \citetitle{databases} book~\cite{databases} at \url{\databasesCodeRepo} as example. |
| 268 | +This repository comes with a file \textil{requirements.txt}, which allows us to present the workflow of cloning a \git\ repository with setting up a \pgls{virtualEnvironment} and installing required packages into one single example. |
267 | 269 |
|
268 |
| -In \cref{fig:gitClonePycharm01website}, we pretend that you came across this interesting repository on \github\ using your normal web browser |
| 270 | +Therefore, in \cref{fig:gitClonePycharm01website}, we pretend that you came across this interesting repository on \github\ using your normal web browser. |
269 | 271 | If you visit \url{\databasesCodeRepo}, you can see the big drop down menu~\menu{Code}.
|
270 |
| -If you click on it, it shows the HTTPS URL under which the project can be found in \cref{fig:gitClonePycharm02copyUrl}. |
271 |
| -If you work with \github, there are two ways to write a URL to a repository:% |
| 272 | +If you click on it, it shows the \pgls{HTTPS} \pgls{URL} under which the project can be found in \cref{fig:gitClonePycharm02copyUrl}. |
| 273 | +If you work with \github, there are two ways to write a \pgls{URL} to a repository:% |
272 | 274 | %
|
273 | 275 | \begin{itemize}%
|
274 | 276 | %
|
275 |
| -\item \url{https://github.com/user/repository} (or \url{https://github.com/user/repository.git}) use the HTTPS protocol to access the repository \textil{repository} of user \textil{user}. % |
| 277 | +\item \url{https://github.com/user/repository} (or \url{https://github.com/user/repository.git}) use \pgls{HTTPS} protocol to access the repository \textil{repository} of user \textil{user}. % |
276 | 278 | This form is often and commonly used.%
|
277 | 279 | %
|
278 |
| -\item \url{ssh:// [email protected]/user/repository} (or \url{ssh:// [email protected]/user/repository.git}) use SSH protocol to access the repository \textil{repository} of user \textil{user}. % |
| 280 | +\item \url{ssh:// [email protected]/user/repository} (or \url{ssh:// [email protected]/user/repository.git}) use \pgls{SSH } to access the repository \textil{repository} of user \textil{user}. % |
279 | 281 | I find this form more reliable when working with \github\ from China.%
|
280 | 282 | %
|
281 | 283 | \end{itemize}%
|
282 | 284 | %
|
283 | 285 | Here, obviously, \textil{user} is \textil{thomasWeise}, which is my personal \github\ account, and \textil{repository} is \textil{databasesCode}.
|
284 |
| -The URL that will be copied to the clipboard by clicking the button in \cref{fig:gitClonePycharm02copyUrl} is \url{https://github.com/thomasWeise/databasesCode.git}. |
| 286 | +The \pgls{URL} that will be copied to the clipboard by clicking the button in \cref{fig:gitClonePycharm02copyUrl} is \url{\databasesCodeRepo.git}. |
| 287 | +If you wanted to clone the repository with the example codes for this book instead, you would use \url{\programmingWithPythonCodeRepo.git}. |
| 288 | + |
285 | 289 | It is important to understand, however, that creating projects by cloning \git\ repositories is by no means restricted to \github.
|
286 | 290 | As stated before, \git\ is a \pgls{client}-\pgls{server} application.
|
287 | 291 | You could work in an enterprise that runs its own \git\ \pgls{server}.
|
288 | 292 | You could work with other \git-based repository hosts like \pgls{gitee}.
|
289 |
| -Regardless of what \git\ service you use, you could use the very same way to type in the corresponding repository URL and then clone the repository in the same way. |
290 |
| -Only the structure of the URLs may be different. |
| 293 | +Regardless of what \git\ service you use, you could use the very same way to type in the corresponding repository \pgls{URL} and then clone the repository in the same way. |
| 294 | +Only the structure of the \pglspl{URL} may be different. |
291 | 295 |
|
292 |
| -In \cref{fig:gitClonePycharm02copyUrl}, we click on the button for copying the URL to the clipboard. |
293 |
| -Now the URL is copied to the clipboard (\cref{fig:gitClonePycharm03copiedUrl}) and we can paste it wherever we like via~\keys{\ctrl+V}. |
| 296 | +In \cref{fig:gitClonePycharm02copyUrl}, we click on the button for copying the \pgls{URL} to the clipboard. |
| 297 | +Now the \pgls{URL} is copied to the clipboard (\cref{fig:gitClonePycharm03copiedUrl}) and we can paste it wherever we like via~\keys{\ctrl+V}. |
294 | 298 | But where shall we paste it?
|
295 | 299 |
|
296 | 300 | We open \pycharm.
|
|
301 | 305 | In that case, we click through \menu{\pycharmMainMenu > File > Project from Version Control\dots}.
|
302 | 306 |
|
303 | 307 | Either way, the \inQuotes{Clone Repository} form appears in \cref{fig:gitClonePycharm05cloneRepositoryForm}.
|
304 |
| -Normally, we would now write the URL of the repository that we want to clone into the \menu{URL:} field. |
305 |
| -Here, we paste the repository URL that we copied from the \github\ page with \keys{\ctrl + V}. |
| 308 | +Normally, we would now write the \pgls{URL} of the repository that we want to clone into the \menu{URL:} field. |
| 309 | +Here, we paste the repository \pgls{URL} that we copied from the \github\ page with \keys{\ctrl + V}. |
306 | 310 | We also enter a directory where the repository should be copied to into the \menu{Directory:} field.
|
307 | 311 | This directory is where all the files will be downloaded to.
|
308 | 312 | You would normally select some appropriate place in your filesystem where you store your program codes.
|
|
0 commit comments