|
1 | 1 | # git-workshop |
2 | | -Repo for the Git Workshop hosted by SCE |
| 2 | +#### Welcome to the Git Workshop hosted by SCE |
| 3 | + |
| 4 | +Today we are going to learn the following: |
| 5 | +- What is Git/GitHub |
| 6 | +- Basic Version Control |
| 7 | +- Pulling and Pushing Branches |
| 8 | +- Switching/Creating Branches |
| 9 | + |
| 10 | +--- |
| 11 | +### First Steps: |
| 12 | +1. Install Git |
| 13 | + - If you dont have Git installed, you will need to install it onto your operating system |
| 14 | + |
| 15 | +| Operating System | Relevant Links | |
| 16 | +| --- | --- | |
| 17 | +| Windows | [Link Here](https://git-scm.com/download/win) | |
| 18 | +| Mac | [Link Here](https://git-scm.com/download/mac) | |
| 19 | +| Linux | [Link Here](https://git-scm.com/download/linux) | |
| 20 | + |
| 21 | +<details> |
| 22 | +<summary> Additional Notes for Mac</summary> |
| 23 | + - There are several ways to install git onto your system. of the options, we reccomend homebrew which you can install with the following command: |
| 24 | + |
| 25 | + ``` |
| 26 | + $(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh) |
| 27 | + ``` |
| 28 | + |
| 29 | +</details> |
| 30 | + |
| 31 | +--- |
| 32 | +### Cloning the repo: |
| 33 | +2. Next lets try cloning the repo. |
| 34 | +- For this we will be using <code style="color:#A9FFF7">git clone</code>. |
| 35 | +- Make sure you are in the folder you want to put the repo into |
| 36 | + |
| 37 | +``` |
| 38 | +git clone https://github.com/SCE-Development/git-workshop.git |
| 39 | +``` |
| 40 | + |
| 41 | +--- |
| 42 | + |
| 43 | +### Creating your branch: |
| 44 | +3. Now we are going to create a branch specifically for you to work on. There are two types of branches that we can use |
| 45 | + |
| 46 | +| Local | Remote | |
| 47 | +| --- | --- | |
| 48 | +| Stored on your computer | Stored on Github | |
| 49 | + |
| 50 | +- Today we will be creating a local branch and publishing it onto the workshop repository |
| 51 | + |
| 52 | +We can create our branch a couple different ways: |
| 53 | + |
| 54 | +<details> |
| 55 | +<summary> Using Git Checkout</summary> |
| 56 | +git checkout -b [INSERT YOUR BRANCH NAME] |
| 57 | +</details> |
| 58 | + |
| 59 | +<details> |
| 60 | +<summary> Using Git Branch</summary> |
| 61 | +git branch [INSERT YOUR BRANCH NAME] |
| 62 | + |
| 63 | +git checkout [INSERT YOUR BRANCH NAME] |
| 64 | +</details> |
| 65 | + |
| 66 | +--- |
| 67 | + |
| 68 | +### Pushing your changes: |
| 69 | +4. We want to make sure we are currently on our new branch. |
| 70 | +- Make sure to use <code style="color:#A9FFF7">git branch</code> to view the branch you are on. |
| 71 | +- You can switch to your branch by using "<code style="color:#A9FFF7">git checkout [INSERT YOUR BRANCH NAME]</code>" |
| 72 | + |
| 73 | + Steps: |
| 74 | + 1. Change line 144 in your index.html to your name. |
| 75 | + 2. In your terminal, you want to commit the changes you have made so type the following: |
| 76 | + ``` |
| 77 | + git commit -m "[INSERT YOUR MESSAGE HERE]" index.html |
| 78 | + ``` |
| 79 | + 3. Once this is complete, you've officially made your first commit. |
| 80 | + 4. Then type <code style="color:#A9FFF7">git push</code> into your terminal |
| 81 | +--- |
| 82 | +### Check for everyone else's branches |
| 83 | +5. Remember <code style="color:#A9FFF7">git fetch</code>? Now we should be able to see everyone else's branches on the remote repository when we type <code style="color:#A9FFF7">git fetch</code>. |
| 84 | +
|
| 85 | +
|
| 86 | +--- |
| 87 | +## <code style="color:#6D98BA"> Congrats, you know the basics of committing and pushing to Git! </code> |
0 commit comments