|
| 1 | + |
| 2 | +--- |
| 3 | +title: "Syncing your project with GitLab" |
| 4 | +teaching: 10 |
| 5 | +exercises: 2 |
| 6 | +--- |
| 7 | + |
| 8 | +:::::::::::::::::::::::::::::::::::::: questions |
| 9 | + |
| 10 | +- How do you keep your project synced using GitLab? |
| 11 | +- Why should you consider using UW-Madison instance of GitLab? |
| 12 | + |
| 13 | +:::::::::::::::::::::::::::::::::::::::::::::::: |
| 14 | + |
| 15 | +::::::::::::::::::::::::::::::::::::: objectives |
| 16 | + |
| 17 | +- Simulate how to pull and push between two different "computers". |
| 18 | +- Discuss what are the advantages of using [UW-Madison Gitlab instance](https://git.doit.wisc.edu) vs Github. |
| 19 | + |
| 20 | +:::::::::::::::::::::::::::::::::::::::::::::::: |
| 21 | + |
| 22 | +## Pushing and pulling between two computers |
| 23 | + |
| 24 | +Let's pretend for a minute that you have a computer at home and one at work. It would be nice your work is kept synced between the two locations. Git + GitLab can help with this. |
| 25 | + |
| 26 | +We are going to simulate the two computers situations by creating a copy of your project in a different location on the computer your are not working on. |
| 27 | + |
| 28 | +The key dynamic we want to follow is *push and pull*. |
| 29 | + |
| 30 | +1. After completing a task, *push* to the remote repo; that way your work is saved to GitLab. |
| 31 | +2. When you got to your second device, *pull*; your saved work is pulled from the remote repo into your "work device". |
| 32 | + |
| 33 | +To create a copy of the project on your "work computer", we are going to practice cloning a project from GitLab |
| 34 | + |
| 35 | +- Go to your repo on GitLab and grab the `Clone with SSH` url from the `Code` button. |
| 36 | +- On RStudio, go to `File` > `New Project`. This will open a popup window. Pick the `Version Control` option. Pick `Git` and click `Next`. |
| 37 | +- The next window gives you a place to paste the url you got from GitLab and the location on your computer to create the project. Navigate to your `Documents` folder and name it `work-computer`. |
| 38 | +- Click `Create Project`. Git will make a copy of your project in this new location. Now you have two computers to practice pushing and pulling from each other! |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | +<!-- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: instructor --> |
| 46 | + |
| 47 | +<!-- Inline instructor notes can help inform instructors of timing challenges --> |
| 48 | +<!-- associated with the lessons. They appear in the "Instructor View" --> |
| 49 | + |
| 50 | +<!-- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: --> |
| 51 | + |
| 52 | +::::::::::::::::::::::::::::::::::::: challenge |
| 53 | + |
| 54 | +## Challenge 1: How does this worklow affects you? |
| 55 | + |
| 56 | +- Does your usual workflow requires using two computers? |
| 57 | +- Do you see yourself using this workflow on a daily basis? |
| 58 | +- What questions do you have? |
| 59 | + |
| 60 | +:::::::::::::::::::::::: solution |
| 61 | + |
| 62 | +## Output |
| 63 | + |
| 64 | +Open the floor for discussions and/or questions from the learners. |
| 65 | + |
| 66 | +::::::::::::::::::::::::::::::::: |
| 67 | + |
| 68 | +Why should you consider using GitLab (rather than GitHub) |
| 69 | + |
| 70 | +::::::::::::::::::::::::::::::::::::: callout |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | +:::::::::::::::::::::::::::::::::::::::::::::::: |
| 75 | + |
| 76 | + |
0 commit comments