Skip to main content
Chemistry LibreTexts

3.13: GitHub Desktop

  • Page ID
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    GitHub Desktop is an easy way to connect your local git repository to a remote GitHub repository.  You first need to install it from this site here:

    Note, GitHub Desktop does not install Git, and we have to install it separately if we want to use command line operations.  You need to connect the desktop to your github account. One of the nice things this does is allow you to avoid setting up SSH keys for authentication as it is done behind the scenes.  If you run into issues, go to the Github Docs on Authenticating GitHub to GitHub Desktop.


    Cloning a GitHub Repo

    If you go to a GitHub Repo and want to clone it you can click on code, and choose "Open with GitHub Desktop" and then choose "Open GitHubDesktop.exe" and a bunch of things are done under the hood.  It creates a folder in the path you specify and creates (initializes) the .git file for the working directory (if you do not see it on Windows click the view menu/hidden items), copies the commit history from the remote to the local, and then it copies all the files from the latest commit to the working folder.

    clipboard_e5b5b500ebe98ddcccb60c53ab1caf309.pngFigure \(\PageIndex{1}\): Copy and Paste Caption here. (Copyright; author via source)

    Committing changes to main

    In figure \(\PageIndex{2}\) several files were deleted (red squares with negative signs) and others were added or renamed (green squares with plus signs) and these edits were done using windows Explorer.  By clicking "Commit to main" the add to staging step is bypassed and the files are made as commits and indexed in the .git file with an associated hash tag.  Once complete the GUI looks like figure \(\PageIndex{4}\) and you can push the local changes from your git repository to the remote GitHub repository.


    clipboard_e2cbef4b6b68736f88b0abbf06ca4ab75.pngFigure \(\PageIndex{2}\):There are seven changes that will be placed in a commit once you hit "commit to main". (Belford CC 0.0)

    If you click the History tab you can see all the commits and by clicking on one of them you can see what was added or deleted in that commit, as in figure \(\PageIndex{3}\)

    clipboard_eee4f9d232525086212d1b0c369e6f1fc.pngFigure \(\PageIndex{3}\): Here we clicked the History tab and can see the hisroty of commits.  If you click any commit it will show the changes, if material was deleted it would show in pink.  If you want to push the latest commit to GitHub you click "push origin" (Belford CC 0.0)

    If you hover over the d2e7be6 in \(\(PageIndex(3}\) you will see the full hash of the commit 

    Commit Messages

    There should only be one message per commit, and it should be in present tense, not past tense.  Commit message are very important, especially for team work where there may be a merge conflict.


    Push to GitHub


    clipboard_ece1ba5fdf221c68f67c793c723863180.pngFigure \(\PageIndex{4}\): Copy and Paste Caption here. (Copyright; author via source)

    When you click Push origin the local repo syncs with the remote repo in GitHub

    clipboard_e35126a141ed2b426c996e636f023b831.pngFigure \(\PageIndex{5}\): Copy and Paste Caption here. (Copyright; author via source)


    Note -Collaborative Work

    If you are on a team you should pull from github to be sure you have the latest version, and then push your commit.





    3.13: GitHub Desktop is shared under a not declared license and was authored, remixed, and/or curated by LibreTexts.

    • Was this article helpful?