+ - 0:00:00
Notes for current slide
Notes for next slide

Connecting to Your UI GitLab Repository

Luke Tierney

University of Iowa

2024-01-19

1 / 45

Prereqisites

Make sure that:

2 / 45

Prereqisites

Make sure that:

  • You have git installed on your computer.
3 / 45

Prereqisites

Make sure that:

  • You have git installed on your computer.

  • You have introduced yourself to git using git config in a shell or usethis::use_git_config.

4 / 45

Prereqisites

Make sure that:

5 / 45

Prereqisites

Make sure that:

Look at the brief introduction to git or the beginning of https://happygitwithr.com if you still need to do any of this.

6 / 45

Prereqisites

Make sure that:

Look at the brief introduction to git or the beginning of https://happygitwithr.com if you still need to do any of this.

The first chapter of https://happygitwithr.com and the brief introduction to git provide some background on git.

7 / 45

Option 1: Use Rstudio

In RStudio open a New Project from the File menu, choose the Version Control option, and Git as the version control system.

8 / 45

Option 1: Use Rstudio

In RStudio open a New Project from the File menu, choose the Version Control option, and Git as the version control system.

  • Your repository URL will be

    https://research-git.uiowa.edu/stat4580-spring-2024/<hawkid>.git

    with <hawkid> replaced with your HawkID.

9 / 45

Option 1: Use Rstudio

In RStudio open a New Project from the File menu, choose the Version Control option, and Git as the version control system.

  • Your repository URL will be

    https://research-git.uiowa.edu/stat4580-spring-2024/<hawkid>.git

    with <hawkid> replaced with your HawkID.

  • You can accept the defaults for the directory name and location or chose something else.

10 / 45

Option 1: Use Rstudio

In RStudio open a New Project from the File menu, choose the Version Control option, and Git as the version control system.

  • Your repository URL will be

    https://research-git.uiowa.edu/stat4580-spring-2024/<hawkid>.git

    with <hawkid> replaced with your HawkID.

  • You can accept the defaults for the directory name and location or chose something else.

  • Don't choose a directory name with spaces in it.

11 / 45

Option 1: Use Rstudio

In RStudio open a New Project from the File menu, choose the Version Control option, and Git as the version control system.

  • Your repository URL will be

    https://research-git.uiowa.edu/stat4580-spring-2024/<hawkid>.git

    with <hawkid> replaced with your HawkID.

  • You can accept the defaults for the directory name and location or chose something else.

  • Don't choose a directory name with spaces in it.

Open the README.md file for your project in RStudio, add something to it, and save the changes.

12 / 45

Option 1: Use Rstudio

In RStudio open a New Project from the File menu, choose the Version Control option, and Git as the version control system.

  • Your repository URL will be

    https://research-git.uiowa.edu/stat4580-spring-2024/<hawkid>.git

    with <hawkid> replaced with your HawkID.

  • You can accept the defaults for the directory name and location or chose something else.

  • Don't choose a directory name with spaces in it.

Open the README.md file for your project in RStudio, add something to it, and save the changes.

From the Tools menu choose Version Control and then Commit.

13 / 45

Option 1: Use Rstudio

In RStudio open a New Project from the File menu, choose the Version Control option, and Git as the version control system.

  • Your repository URL will be

    https://research-git.uiowa.edu/stat4580-spring-2024/<hawkid>.git

    with <hawkid> replaced with your HawkID.

  • You can accept the defaults for the directory name and location or chose something else.

  • Don't choose a directory name with spaces in it.

Open the README.md file for your project in RStudio, add something to it, and save the changes.

From the Tools menu choose Version Control and then Commit.

Check the box next to README.md, write a commit message, and press the Commit button.

14 / 45

Option 1: Use Rstudio

In RStudio open a New Project from the File menu, choose the Version Control option, and Git as the version control system.

  • Your repository URL will be

    https://research-git.uiowa.edu/stat4580-spring-2024/<hawkid>.git

    with <hawkid> replaced with your HawkID.

  • You can accept the defaults for the directory name and location or chose something else.

  • Don't choose a directory name with spaces in it.

Open the README.md file for your project in RStudio, add something to it, and save the changes.

From the Tools menu choose Version Control and then Commit.

Check the box next to README.md, write a commit message, and press the Commit button.

Close the version control window. Your changes have been committed to your local repository.

15 / 45

Option 1: Use Rstudio

In RStudio open a New Project from the File menu, choose the Version Control option, and Git as the version control system.

  • Your repository URL will be

    https://research-git.uiowa.edu/stat4580-spring-2024/<hawkid>.git

    with <hawkid> replaced with your HawkID.

  • You can accept the defaults for the directory name and location or chose something else.

  • Don't choose a directory name with spaces in it.

Open the README.md file for your project in RStudio, add something to it, and save the changes.

From the Tools menu choose Version Control and then Commit.

Check the box next to README.md, write a commit message, and press the Commit button.

Close the version control window. Your changes have been committed to your local repository.

You can also use the Git panel for the preceding steps.

16 / 45

Option 1: Use Rstudio

To push your changes to GitLab, from the Tools menu choose Version Control and then Push Branch. You may have to provide your HawkID and password at this point.

17 / 45

Option 1: Use Rstudio

To push your changes to GitLab, from the Tools menu choose Version Control and then Push Branch. You may have to provide your HawkID and password at this point.

You should now be able to see your changes in your remote repository in the class group.

18 / 45

Option 1: Use Rstudio

To push your changes to GitLab, from the Tools menu choose Version Control and then Push Branch. You may have to provide your HawkID and password at this point.

You should now be able to see your changes in your remote repository in the class group.

A video from 2022 is available that walks through this process.

19 / 45

Option 1: Use Rstudio

To push your changes to GitLab, from the Tools menu choose Version Control and then Push Branch. You may have to provide your HawkID and password at this point.

You should now be able to see your changes in your remote repository in the class group.

A video from 2022 is available that walks through this process.

The video also shows some basic use of markdown syntax.

20 / 45

Option 2: Using the Shell

Open a shell.

21 / 45

Option 2: Using the Shell

Open a shell.

Go to the parent directory where you want your local repository to live.

22 / 45

Option 2: Using the Shell

Open a shell.

Go to the parent directory where you want your local repository to live.

In the shell, give the command

git clone https://research-git.uiowa.edu/stat4580-spring-2024/<hawkid>.git <dirname>

with <hawkid> replaced by your Hawk ID and <dirname> by the directory name you want.

23 / 45

Option 2: Using the Shell

Open a shell.

Go to the parent directory where you want your local repository to live.

In the shell, give the command

git clone https://research-git.uiowa.edu/stat4580-spring-2024/<hawkid>.git <dirname>

with <hawkid> replaced by your Hawk ID and <dirname> by the directory name you want.

You can omit the directory name <dirname> if you are happy with the default, the name of your repository. If you choose your own directory name, do not choose one with spaces in it.

24 / 45

Option 2: Using the Shell

Open a shell.

Go to the parent directory where you want your local repository to live.

In the shell, give the command

git clone https://research-git.uiowa.edu/stat4580-spring-2024/<hawkid>.git <dirname>

with <hawkid> replaced by your Hawk ID and <dirname> by the directory name you want.

You can omit the directory name <dirname> if you are happy with the default, the name of your repository. If you choose your own directory name, do not choose one with spaces in it.

Change your working directory to your local repository (cd <dirname> on Linux).

25 / 45

Option 2: Using the Shell

Open a shell.

Go to the parent directory where you want your local repository to live.

In the shell, give the command

git clone https://research-git.uiowa.edu/stat4580-spring-2024/<hawkid>.git <dirname>

with <hawkid> replaced by your Hawk ID and <dirname> by the directory name you want.

You can omit the directory name <dirname> if you are happy with the default, the name of your repository. If you choose your own directory name, do not choose one with spaces in it.

Change your working directory to your local repository (cd <dirname> on Linux).

Edit README.md and save.

26 / 45

Option 2: Using the Shell

Open a shell.

Go to the parent directory where you want your local repository to live.

In the shell, give the command

git clone https://research-git.uiowa.edu/stat4580-spring-2024/<hawkid>.git <dirname>

with <hawkid> replaced by your Hawk ID and <dirname> by the directory name you want.

You can omit the directory name <dirname> if you are happy with the default, the name of your repository. If you choose your own directory name, do not choose one with spaces in it.

Change your working directory to your local repository (cd <dirname> on Linux).

Edit README.md and save.

Commit your changes with the command

git commit -m "My commit message." README.md
27 / 45

Option 2: Using the Shell

Push your changes with the command

git push
28 / 45

Option 2: Using the Shell

Push your changes with the command

git push

If you want to manage this repository from RStudio you can turn it into an RStudio project by creating a new project and choosing the Existing Directory option.

29 / 45

Creating and Submitting Your First Assignment

Create a new folder HW1 in your project; you can do this

30 / 45

Creating and Submitting Your First Assignment

Create a new folder HW1 in your project; you can do this

  • in RStudio with the Files panel;
31 / 45

Creating and Submitting Your First Assignment

Create a new folder HW1 in your project; you can do this

  • in RStudio with the Files panel;

  • using your computer's file browser;

32 / 45

Creating and Submitting Your First Assignment

Create a new folder HW1 in your project; you can do this

  • in RStudio with the Files panel;

  • using your computer's file browser;

  • in a bash shell using mkdir;

33 / 45

Creating and Submitting Your First Assignment

Create a new folder HW1 in your project; you can do this

  • in RStudio with the Files panel;

  • using your computer's file browser;

  • in a bash shell using mkdir;

  • in the R console using dir.create.
34 / 45

Creating and Submitting Your First Assignment

Create a new folder HW1 in your project; you can do this

  • in RStudio with the Files panel;

  • using your computer's file browser;

  • in a bash shell using mkdir;

  • in the R console using dir.create.

Create a new R Markdown document hw1.Rmd

35 / 45

Creating and Submitting Your First Assignment

Create a new folder HW1 in your project; you can do this

  • in RStudio with the Files panel;

  • using your computer's file browser;

  • in a bash shell using mkdir;

  • in the R console using dir.create.

Create a new R Markdown document hw1.Rmd

  • in RStudio using File > New File > R Markdown;
36 / 45

Creating and Submitting Your First Assignment

Create a new folder HW1 in your project; you can do this

  • in RStudio with the Files panel;

  • using your computer's file browser;

  • in a bash shell using mkdir;

  • in the R console using dir.create.

Create a new R Markdown document hw1.Rmd

  • in RStudio using File > New File > R Markdown;

    if the STAT4580 package is installed you can chose the STAT4580 Homework template;

37 / 45

Creating and Submitting Your First Assignment

Create a new folder HW1 in your project; you can do this

  • in RStudio with the Files panel;

  • using your computer's file browser;

  • in a bash shell using mkdir;

  • in the R console using dir.create.

Create a new R Markdown document hw1.Rmd

38 / 45

Creating and Submitting Your First Assignment

Create a new folder HW1 in your project; you can do this

  • in RStudio with the Files panel;

  • using your computer's file browser;

  • in a bash shell using mkdir;

  • in the R console using dir.create.

Create a new R Markdown document hw1.Rmd

Edit, preview, stage, and commit locally.

39 / 45

Creating and Submitting Your First Assignment

Create a new folder HW1 in your project; you can do this

  • in RStudio with the Files panel;

  • using your computer's file browser;

  • in a bash shell using mkdir;

  • in the R console using dir.create.

Create a new R Markdown document hw1.Rmd

Edit, preview, stage, and commit locally.

Push to GitLab.

40 / 45

Some Notes

It is a good idea to commit often.

41 / 45

Some Notes

It is a good idea to commit often.

If you work on several computers, or with a collaborator, be sure to pull changes from the repository before starting to work on new changes.

42 / 45

Some Notes

It is a good idea to commit often.

If you work on several computers, or with a collaborator, be sure to pull changes from the repository before starting to work on new changes.

You do not have to push after every commit, but it's a good idea to do so.

43 / 45

Some Notes

It is a good idea to commit often.

If you work on several computers, or with a collaborator, be sure to pull changes from the repository before starting to work on new changes.

You do not have to push after every commit, but it's a good idea to do so.

A video from 2022 is available that walks through starting on the first assignment.

44 / 45

Exercises

  1. Take possession of your GitLab repository.

  2. Edit your README.md file, commit, and push your changes.

  3. Check that you can see your changes on the UI GitLab site. Find the SHA hash for your commit.

  4. Get set up to work on the first assignment.

45 / 45

Prereqisites

Make sure that:

2 / 45
Paused

Help

Keyboard shortcuts

, , Pg Up, k Go to previous slide
, , Pg Dn, Space, j Go to next slide
Home Go to first slide
End Go to last slide
Number + Return Go to specific slide
b / m / f Toggle blackout / mirrored / fullscreen mode
c Clone slideshow
p Toggle presenter mode
t Restart the presentation timer
?, h Toggle this help
Esc Back to slideshow
//adapted from Emi Tanaka's gist at //https://gist.github.com/emitanaka/eaa258bb8471c041797ff377704c8505