{"id":49151722,"url":"https://github.com/badgerloop-software/github-tutorial","last_synced_at":"2026-04-22T06:11:41.358Z","repository":{"id":43739336,"uuid":"412098147","full_name":"badgerloop-software/github-tutorial","owner":"badgerloop-software","description":null,"archived":false,"fork":false,"pushed_at":"2025-09-14T18:00:17.000Z","size":17,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-09-14T20:16:40.901Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/badgerloop-software.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-09-30T14:29:18.000Z","updated_at":"2025-02-01T18:39:34.000Z","dependencies_parsed_at":"2023-02-15T13:50:32.322Z","dependency_job_id":"db5b7aa5-0826-42a7-b62a-7429cd6e7663","html_url":"https://github.com/badgerloop-software/github-tutorial","commit_stats":null,"previous_names":["badgerloop-software/github-tutorial"],"tags_count":0,"template":false,"template_full_name":"badgerloop-software/github-tutorial-template","purl":"pkg:github/badgerloop-software/github-tutorial","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badgerloop-software%2Fgithub-tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badgerloop-software%2Fgithub-tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badgerloop-software%2Fgithub-tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badgerloop-software%2Fgithub-tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/badgerloop-software","download_url":"https://codeload.github.com/badgerloop-software/github-tutorial/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badgerloop-software%2Fgithub-tutorial/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32123674,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T00:31:26.853Z","status":"online","status_checked_at":"2026-04-22T02:00:05.693Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-22T06:11:39.301Z","updated_at":"2026-04-22T06:11:41.346Z","avatar_url":"https://github.com/badgerloop-software.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Git/GitHub Tutorial\n*Authors: [Eric Udlis](http://ericudlis.com), Ben Everson, Noah Kurszewski, [James Vollmer](https://jamesvollmer.com)*\n\nThis tutorial is to provide instructions on the installation and setup of Git and GitHub and to introduce the basics of Git version control, as well as how to GitHub.\n\nThis Tutorial is based on the one from [hubspot](https://product.hubspot.com/blog/git-and-github-tutorial-for-beginners)\n\n\u003cbr/\u003e\n\n# WSL and Ubuntu Installation and Setup\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eFellow Windows People Start Here if You Want to Have a Good Time\u003c/strong\u003e\u003c/summary\u003e\n\n\u003cbr/\u003e\n\nThis portion of the tutorial is to guide new members in the installation of Windows Subsystem for Linux, or WSL. Windows users, please complete WSL installation before continuing with the GitHub tutorial. If you use Linux/macOS, then you can skip ahead to the GitHub portion.\n\n## Step 0: Install Windows Terminal\nI have found that Windows Terminal works best for WSL, as it combines PowerShell and your WSL distribution into one terminal. If your laptop doesn't already have it installed, you can download it [here](https://www.microsoft.com/store/productId/9N0DX20HK701).\n\n### Open Windows Terminal\nAfter it installs, open Windows terminal as an administrator by right clicking on the Terminal icon, then clicking \"Run as adminstrator.\" Your terminal will likely initially open to Command Prompt or PowerShell. If it doesn't open to PowerShell, click the dropdown arrow to the right of the plus button and select Windows PowerShell.\n\n## Step 1: Install WSL\n\nOnce running PowerShell as an admin, type ```wsl --install``` in the terminal and hit enter. If all goes to plan, WSL will begin installing Ubuntu, and the terminal window will begin outputing its progress. Once the installation finishes, the terminal will tell you that a restart is required. Restart your computer now, then return to the tutorial.\n\nOnce you're back, open Terminal as an admin again, open PowerShell and run the following command: ```wsl --set-default-version 2```. This sets your WSL to the correct version for our use.\n\n[Install link](https://learn.microsoft.com/en-us/windows/wsl/install)\n\n## Step 2: Ubuntu Setup\n\nAfter the restart, an Ubuntu window should open automatically and display the progress of the last of the Ubuntu installation. If it didn't open, use the Start menu or the Windows search bar to search for Ubuntu. It will appear as a Windows application, so open it up like you would any other app. After the installation finishes, you will be asked to enter in a username and password for your distribution. You can choose whatever you'd like for these, but an important thing to note is that you will not be able to see your password as you type. This is a security feature called blind typing, and is completely normaL.\n\nAs you likely noticed, the Ubuntu window did not open in Windows Terminal. Once you've set your login, close out the window and pull up Windows Terminal. To get to Ubuntu in Terminal, click the dropdown arrow to the right of the plus button, then click on Ubuntu.\n\nNow in the Ubuntu terminal, type ```cd ~``` to ensure you're in your root directory. Next, run ```sudo apt update \u0026\u0026 sudo apt upgrade``` to ensure all of your packages are up to date. \n\u003c/details\u003e\n\n\u003cbr/\u003e\n\n# GitHub Tutorial\n\n## Step 0a: Install Git\n\n### Ubuntu\n\nOpen Ubuntu in Windows Terminal by clicking the dropdown arrow to the right of the plus button, then click on Ubuntu. Once in the linux terminal, run the following command to ensure git is installed.\n\n```\nsudo apt install git\n```\n\n### Windows\n\nDownload git [here](https://git-scm.com/downloads). Follow the walkthrough, all default options should be good. Don't touch them unless you know what you're doing.\n\n## Step 0b: Set up GitHub SSH Key\n\n 1. Follow the instructions in the “Generating a new SSH key” section of [Generating a new SSH key](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent). It isn’t necessary to add your SSH key to the ssh-agent.\n 2. Follow the instructions on [Adding the SSH key to your GitHub account](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account).\n    - When you copy your SSH key to GitHub, it should have your email at the end of it. E.g. `ssh-ed25519 \u003cbunch_of_junk\u003e bbadger@wisc.edu`\n\n## Step 0c (Almost There): Configure Your Git User Settings\n\n```\nBucky@BSR~$: git config --global user.name \"\u003cYour name\u003e\"                                                 // Sets the name Git associates with you\nBucky@BSR~$: git config --global user.email \"\u003cThe email that you used to set up your GitHub account\u003e\"    // Sets the email Git associates with you\nBucky@BSR~$: git config --global --list                                                                  // Lists your Git profile information\nuser.email=bbadger@wisc.edu\nuser.name=Bucky Badger\n... Maybe some other stuff if you've added other info, like if you're cool\ncore.editor=vim                                                                                                 // vim is the superior text editor\n```\n\n## Step 1: Clone the Repository\nNo matter what project you're working on in Badger Solar Racing, you will always be working in a repository (Repo for short). To use git we'll be using the terminal. Check out some tutorials on the wiki. In this guide you will need to know the following.\n```\nBucky@BSR~$: ls    // Lists the files and directories in your current directory\nBucky@BSR~$: cd    // Navigates to directory use `cd ..` to navigate up a directory\nBucky@BSR~$: pwd   // Prints your working directory\n```\nWe already have code up on GitHub so the first step is to \"clone\" a copy of what we have on your local machine. To begin, open up a terminal (on windows use Git Bash or WSL to follow the commands used in this tutorial) and navigate to where you'd like your project to be located. If you have a \"projects\" folder, this would be the place. This command will navigate you to your home directory\n```\nBucky@BSR~$: cd ~ \n```\nNext grab the clone link from the GitHub Page. You will need to navigate to the actual webpage of the git repository on GitHub. You can find a list of all Badger Solar Racing Repos by [clicking here](https://github.com/badgerloop-software/). If you're reading this on the GitHub page, just click the green button in the upper right that says \"Code.\" This opens a dropdown window. In that window, click \"SSH\" if it isn't already selected, then copy the link to your clipboard. We'll need it in the next step.\n\nFinally, execute a git clone command to copy the repository to your local machine by typing\n```\nBucky@BSR~$: git clone gitLinkHere\n```\nThis will create a directory with the most up to date version of the repository. Simply navigate into it and you will be inside the repository. Run `git status` to make sure you are in a valid git repo.\n```\nBucky@BSR~$: git status\nOn branch main\nYour branch is up-to-date with 'origin/main'.\n```\n## Step 2: Create a Separate Branch\nBefore we make any commits, we have to talk about branching. Say you want to make a new feature but are worried about making changes to the main project. This is where **git branches** come into play.\n\nOne important branch is the **main** branch. This is reserved for our production ready code. Generally, you finish a feature before making it a part of main. On all Badger Solar Racing repos, this is a locked branch requiring a review in order to make changes to main.\n\nBranches allow you to move back and forth between different \"states\" of a project. All work done in Badger Solar Racing will take place in a separate branch before being a part of main. This way each member can work on a sub-project without interfering with other's work.\n\nLet's create a branch by using the `git checkout` command with the `-b` flag. Let's create a branch called `{yourname}_tutorial` and confirm with the `git branch` command.\n\n```\nBucky@BSR~$: git checkout -b Bucky_tutorial\nBucky@BSR~$: git branch\n* Bucky_tutorial\n  main\n```\n## Step 3: Add a New File to the Repo\nLet's add a new file to the project in the `members/` directory. For this we are going to use the `touch` command. `touch` will create an empty file. Create a text file titled by your first and last name and the current semester.\n```\nBucky@BSR~$: touch members/bucky-badger-fa23.txt\nBucky@BSR~$: ls\nmembers README.md\n```\n\nAfter creating the new file, you can use the `git status` command to see which files git knows about.\n\n```\nBucky@BSR~$: git status\nOn branch Bucky_tutorial\nUntracked files:\n  (use \"git add \u003cfile\u003e...\" to include in what will be committed)\n        members/\n\nno changes added to commit (use \"git add\" and/or \"git commit -a\")\n```\nor if the `members/` directory already has a file in it that's tracked by git,\n```\nBucky@BSR~$: git status\nOn branch Bucky_tutorial\nUntracked files:\n  (use \"git add \u003cfile\u003e...\" to include in what will be committed)\n        members/bucky-badger-fa23.txt\n\nno changes added to commit (use \"git add\" and/or \"git commit -a\")\n```\n\nBasically, this means \"Hey, we noticed you make a new file called bucky-badger-fa23.txt in members/, but unless you use the `git add` command, we aren't going to do anything about it.\n\n## Step 3b: The Staging Environment\nGit works on a concept called the staging environment, this is one of the most confusing parts of git. Let's go through some terminology.\n\n### Commit\nA commit is a record of what files you have changed since last time you made a commit. Essentially you make changes to the repo (either by adding, deleting, or modifying files) and you \"commit\" to your changes by telling git to put those files into a commit.\n\nThis is where the version control comes in. You can backtrack to any previous commit at any point.\n\n### Staging Environment\nSo, how do you tell git which files to put into a commit? This is where the staging environment comes in. As seen in Step 2, when you make changes to your repo, git notices that a file has changed but won't do anything with it. **Git will not automatically add your files to a commit**\n\n## Step 4: Add a File to the Staging Environment\nAdd a file to the staging environment by using the `git add` command\n```\nBucky@BSR~$: git add members/bucky-badger-fa23.txt\nBucky@BSR~$: git status\nOn branch Bucky_tutorial\nChanges to be committed:\n  (use \"git restore --staged \u003cfile\u003e...\" to unstage)\n        new file:   members/bucky-badger-fa23.txt\n```\n## Step 5: Commit Your Changes\nIt's time to create your first commit!\n\nRun the `git commit -m \"{Your commit message}` command.\n\nThe `-m` flag means the next string will be a commit message. It is important to create meaningful commit messages so everyone knows what changes were made. It could be a new feature, fixing a bug, or even just fixing a typo. Please, please, please don't type \"asdfasdfasdf\" or \"whatever\". \n\n```\nBucky@BSR~$: git commit -m \"Added my file to members to mark my contribution\"\n[Bucky_tutorial (root-commit) b345d9a] Added my file to members to mark my contribution\n 1 file changed, 1 insertion(+)\n create mode 100644 members/bucky-badger-fa23.txt\n ```\n\n ## Step 5b: A \"Better\" Way\n\n When working with several files, it gets tedious to list every single file for one commit. An easier way to commit several files is to run the `git commit` command with the `-am` flag. As we learned earlier, `-m` means you're adding a message to your commit. The `-a` flag means you want to commit all changed files.\n ```\n Bucky@BSR~$: git commit -am \"Added my file to members to mark my contribution\"\n [Bucky_tutorial (root-commit) b345d9a] Added my file to members to mark my contribution\n 1 file changed, 1 insertion(+)\n create mode 100644 members/bucky-badger-fa23.txt\n ```\nWhile this can be convenient, it can also be troublesome if you have tentative changes or files that shouldn't be committed, as those could be pulled into the commit without you realizing it.\n\n## Step 6: Push a branch to GitHub\n\nNow that we are done with our change, we are ready to **push** it to GitHub. This allows other people to see the changes you've made, and eventually be put into main.\n\nTo push changes on a new GitHub Branch we'll use the `git push origin {your branch name}` command. Origin is just an alias for the repository's url.\n\n```\nBucky@BSR~$: git push origin Bucky_tutorial\nCounting objects: 3, done.\nDelta compression using up to 8 threads.\nCompressing objects: 100% (2/2), done.\nWriting objects: 100% (3/3), 313 bytes | 0 bytes/s, done.\nTotal 3 (delta 0), reused 0 (delta 0)\nTo https://github.com/badgerloop-software/github-tutorial.git\n * [new branch]      Bucky_tutorial -\u003e Bucky_tutorial\n```\n\nAt this point it may ask you to log in with your username and password.\n\nFinally, if you refresh the GitHub page, you'll see a note of recently pushed branches, yours may be there, or click the \"branches\" link to see your branch listed there.\n\n## Step 7: Creating a Pull Request\n\nA pull request (or PR) is a way to alert the team leads that you want to make some changes to the codebase. It allows them, as well as other Badger Solar Racing members to review the code and make sure it looks good before putting your changes on the main branch.\n\nTo start a pull request. Click the \"New Pull Request\" button on next to your branch.\n\n![pull request image](https://i.imgur.com/ODualXT.png)\n\nBe sure to give your PR a meaningful title and description. On the Software team we have a checklist of self-checks to go through before you post a PR. You may see a big green button at the bottom that says \"Merge Pull Request\" Clicking this means you'll merge your changes into the main branch. \n\n***Note If you are doing this tutorial as part of a Software Meeting, you will be required to get a review as if it was a real PR***\n\nNote that this button won't always be green. In some cases it'll be grey, which means you're faced with the dreadded *merge conflicts*. This is when there is a change in one file the conflicts with a change somewhere else (either in that file or elsewhere) and git can't figure out which version to use. You'll have to manually go in an tell git which version to use.\n\nOnce the button is green, go ahead and click it. This will merge your changes into the main branch. When you're done, click delete branch as well. This will help with clutter.\n\n## Step 8: Update the Files on Your Computer\n\nRight now the repo on GitHub looks a little different than what you have on your computer. For example, the merge commit you just made doesn't exist on your local machine. We need to get the most recent changes with a `git pull` command.\n\n```\nBucky@BSR~$: git checkout main\nSwitched to branch 'main'\nBucky@BSR~$: git pull\nremote: Counting objects: 1, done.\nremote: Total 1 (delta 0), reused 0 (delta 0), pack-reused 0\nUnpacking objects: 100% (1/1), done.\nFrom https://github.com/badgerloop-software/github-tutorial\n * branch            main     -\u003e FETCH_HEAD\n   b345d9a..5381b7c  main     -\u003e origin/main\nMerge made by the 'recursive' strategy.\n members/bucky-badger-fa23.txt | 1 +\n 1 file changed, 1 insertion(+)\n ```\n\n## Step 9: Give yourself a Pat on the Back\n\nYahoo, you've successfully contributed to a repository! Congratulations, this is the foundation of writing code for Badger Solar Racing and will be used nearly every time you work with Badger Solar Racing.\n\nGood luck in your future quest to git gud :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbadgerloop-software%2Fgithub-tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbadgerloop-software%2Fgithub-tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbadgerloop-software%2Fgithub-tutorial/lists"}