{"id":31565794,"url":"https://github.com/correlaid/git-newbie-playground","last_synced_at":"2025-10-05T07:17:42.343Z","repository":{"id":53087817,"uuid":"349124890","full_name":"CorrelAid/git-newbie-playground","owner":"CorrelAid","description":"This is a repository for Git newbies to fork and play with. ","archived":false,"fork":false,"pushed_at":"2022-04-02T07:21:42.000Z","size":171,"stargazers_count":1,"open_issues_count":0,"forks_count":28,"subscribers_count":4,"default_branch":"main","last_synced_at":"2023-03-02T00:47:17.305Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rebol","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CorrelAid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-18T15:29:42.000Z","updated_at":"2022-04-02T00:59:03.000Z","dependencies_parsed_at":"2022-09-12T12:21:29.312Z","dependency_job_id":null,"html_url":"https://github.com/CorrelAid/git-newbie-playground","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/CorrelAid/git-newbie-playground","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CorrelAid%2Fgit-newbie-playground","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CorrelAid%2Fgit-newbie-playground/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CorrelAid%2Fgit-newbie-playground/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CorrelAid%2Fgit-newbie-playground/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CorrelAid","download_url":"https://codeload.github.com/CorrelAid/git-newbie-playground/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CorrelAid%2Fgit-newbie-playground/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278421863,"owners_count":25984081,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"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":"2025-10-05T07:17:41.222Z","updated_at":"2025-10-05T07:17:42.337Z","avatar_url":"https://github.com/CorrelAid.png","language":"Rebol","funding_links":[],"categories":[],"sub_categories":[],"readme":"# git-newbie-playground\nThis is a repository for Git newbies to fork and play with. \n\n\n# Setup Git and GitHub\n⚠️ Setting up Git on your local machine / laptop can be a bit of a pain and might not work the first time. I tried to describe a way that _should_ work. That being said, I could not test it extensively (because Git is already set up for me and I don't have access to a Windows machine). Please don't give up - once you have set it up correctly you don't need to do this again. ⚠️\n\n**If something does not work for you, please open an issue [here](https://github.com/CorrelAid/git-newbie-playground/issues). That would really help me in improving this material!**\n\n## 1. Create GitHub account\n- Create a GitHub account if you have not already: https://github.com/join\n- Create a **private** repository called `git-tryout`: https://github.com/new . Make sure to tick the \"Add a README file\" box.\n\n## 2. Install Git\n\n### 2.1. Windows\n- install Git: https://git-scm.com/download/win\n- If you have Git installed already, please make sure that you have at **least version 2.29** (required for storing credentials securely): \n```\ngit version \n```\nIf you do not have at least version `2.29`, please update Git: \n\n```\ngit update-git-for-windows\n```\n\n### 2.2. Mac\n- install Git, see [here](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)\n\n### 2.3. Linux\n- Git should already be installed on your machine. To check, please run: \n```\ngit version\n```\nIf not, please google \"install git {your distro}\" and you should find out how to install it.\n\n## 3. Introduce yourself to Git\n\nOpen a terminal (Mac / Linux) or Git Bash (Windows).\n\nCopy each of the following commands, adapt the name and email address (the email address should be the address you used for your GitHub account), and hit enter.\n\n```\ngit config --global user.name 'Jane Doe'\ngit config --global user.email 'jane@example.com'\ngit config --global alias.graph 'log --graph --oneline'\ngit config --global --list\n```\n\n## 4. Authentication\n\n### 4.1. Create a Personal Access Token\n- https://github.com/settings/tokens\n- give it a name like \"personal laptop\" \n- **make sure to give it the \"repo\" scope**\n- copy the token somewhere temporary - but don't save it!\n\nThis is also described in [this guide](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token) \n\nNow, we have to store the Personal Access Token (PAT) on our Laptop and tell Git to use it when communicating with GitHub. In order to do so, we need a Git \"credential helper\".\n\n### 4.2. Store the Personal Access Token safely\n\n### 4.2.1. Windows\n\nOpen Git Bash, copy+paste the following command and hit enter: \n\n```\ngit credential-manager-core configure\n```\n\nthis tells git to use the [credential-manager-core](https://github.com/microsoft/Git-Credential-Manager-Core) as the _credential store_.\n\n\njust to make sure, we also update the git config (this might be necessary if you had git installed before):\n\n```\ngit config --global credential.helper manager-core\n```\n\nIf you get the following error/warning:\n\n```\nwarning: credential.helper has multiple values\nerror: cannot overwrite multiple values with a single value\n       Use a regexp, --add or --replace-all to change credential.helper.\n```\n\nthis means that you already have a credential helper configured. You can check the values like so:\n\n```\ngit config --global --list\n```\n\nif you are sure that you don't need the other credential helpers, you can override all with `credential-manager-core`:\n\n```\ngit config --global --replace-all credential.helper manager-core\n```\n\nwe need to _trigger_ the credential store to save our Personal Access Token in it, so let's clone (\"download\") your private repository `git-tryout` that you created before:\n\n```\ngit clone https://github.com/{your_github_username}/git-tryout\n```\n\nA popup should pop up asking you to authenticate via GitHub. Now, enter your username and **the Personal Access Token** instead of your GitHub password and confirm!\n\n![](images/core-cred-manager-popup.png) \n\nGit should clone your repository. You can confirm it is there by running `ls` in your Git bash window\n\n```\nls\n```\n\n`git-tryout` should be in the list.\n\n### 4.2.2. Mac\nInstall **[Git Credential Manager Core](https://github.com/microsoft/Git-Credential-Manager-Core/releases/tag/v2.0.394-beta)** by downloading and executing the `pkg` installer. \n\nOpen a Terminal, copy+paste the following command and hit enter: \n\n```\ngit credential-manager-core configure\n```\n\nthis configures the credential manager and tells git to use the [credential-manager-core](https://github.com/microsoft/Git-Credential-Manager-Core) as the _credential store_.\n\njust to make sure, we also update the git config (this might be necessary if you had git installed before):\n\n\n```\ngit config --global credential.helper manager-core\n```\n\nIf you get the following error/warning:\n\n```\nwarning: credential.helper has multiple values\nerror: cannot overwrite multiple values with a single value\n       Use a regexp, --add or --replace-all to change credential.helper.\n```\n\nthis means that you already have a credential helper configured. You can check the values like so:\n\n```\ngit config --global --list\n```\n\nif you are sure that you don't need the other credential helpers, you can override all with `credential-manager-core`:\n\n```\ngit config --global --replace-all credential.helper manager-core\n```\n\nwe need to _trigger_ the credential store to save our Personal Access Token in it, so let's clone (\"download\") your private repository `git-tryout` that you created before:\n\n```\ngit clone https://github.com/{your_github_username}/git-tryout\n```\n\nA \"dialogue\" will appear in the terminal. Make sure to select option 2 by typing in \"2\" and hitting enter. Then paste your PAT:\n\n![](images/core-cred-manager.png)\n\nHit enter. \n\nGit should clone your repository. You can confirm it is there by running `ls` in the terminal. The list should include `git-tryout`.\n\n\n### 4.2.2. Linux \n\nYou should use the `libsecret` package, see [this article](https://www.softwaredeveloper.blog/git-credential-storage-libsecret)\n\nIf this is not an option on your Linux distro, you can: \n- install [Git Credential Manager Core](https://github.com/microsoft/Git-Credential-Manager-Core#linux-debian-package-deb)  and then follow the instructions for Mac/Windows above\n- use SSH authentication: \n\n1. Check for pre-existing keys: open a terminal, enter `ls ~/.ssh`\n2. create key if none exists:\n`ssh-keygen -t rsa -C \"your_email@example.com\"`  (replace with email you used for GitHub registration!), accept defaults (default location, no password)\n3. copy to GitHub \n- copy the public key from `id_rsa.pub`\n  - Linux: `cat ~/.ssh/id_rsa.pub` -\u003e copy the output \n- add to GitHub\n  - go to the [SSH keys](https://github.com/settings/keys) section of the GitHub settings and copy your key into the box. Give a meaningful name and click \"add key\"\n  \n## 5. Test your setup\nIf you haven't already in step 4, clone your tryout repository in Git bash / terminal:\n\n```\ngit clone https://github.com/{your_github_username}/git-tryout\n```\n\nYou can also run it again if you are unsure...it will show an error if the folder already exists on your machine. If this happens, it's fine - it means you already have cloned it and the folder exists where you currently are! :) \n\nRun the following to go into the folder: \n\n```\ncd git-tryout\n```\n\nnow create a file, add it to git and upload it to GitHub with the following commands (you'll learn about those in the workshop):\n\n```\ntouch test.txt\ngit add test.txt\ngit commit -m 'add a test file'\ngit push\n```\n\nIf it says something like the following in the output, you're fine:\n\n```bash\nDelta compression using up to 8 threads\nCompressing objects: 100% (2/2), done.\nWriting objects: 100% (3/3), 923 bytes | 923.00 KiB/s, done.\nTotal 3 (delta 0), reused 0 (delta 0), pack-reused 0\nTo github.com:friep/git-tryout.git\n   5ce4a1f..aa7d778  main -\u003e main\n```\n\n# Markdown syntax\n\n- **bold**\n- _italic_\n- ~~strike~~\n### subheader\n\n\u003e this is a quote\n\nthis links an image from the images folder\n\n![description](images/xkcd_comic.png)\n\nimage from the web\n\n![description](https://imgs.xkcd.com/comics/correlation.png)\n\nSource: https://imgs.xkcd.com/comics/correlation.png\n\nmerge conflicts might be a bit frightening but you can do it! :) \n\n# Troubleshooting \n## It doesn't work with the token!\nYou can also try with just entering your password - especially on Windows, this might work even better (we use the PAT here because it's more cross-platform!)\n\n## it works in the terminal but not with the RStudio Git pane\nYou might have two git versions installed and RStudio might be using an old version which does not support the credential-manager-core credential helper. \n\nTo check, compare the output of \n\n``` \nwhich git\n```\n\nfrom your terminal / Git shell with the global settings in RStudio. Adapt the RStudio settings so that the  paths match!\n\n![Screenshot 2021-07-09 at 09 40 31](https://user-images.githubusercontent.com/13187448/125042062-bb2f7600-e099-11eb-96a3-1c9a376b9405.png)\n\n\n# Resources\n## Read\n- [Git Book - Git Basics Chapter](https://git-scm.com/book/en/v2/Git-Basics-Getting-a-Git-Repository): very good overview! \n- [Happy Git with R](https://happygitwithr.com/): R in RStudio\n- [Git our sh*t together - VSCode](https://gost.netlify.app/en/2019-12-01_correlaid-meetup-berlin/#1): a similar workshop to this one but with the excellent Git VSCode extension\n\n## Practice \n- [Git Katas](https://github.com/muses-code-js/git-katas): command line Git through focused exercises\n- [Learn Git Branching](https://learngitbranching.js.org/): interactive exercises to learn git branching\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorrelaid%2Fgit-newbie-playground","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcorrelaid%2Fgit-newbie-playground","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcorrelaid%2Fgit-newbie-playground/lists"}