{"id":20168582,"url":"https://github.com/manuelandersen/learn-git","last_synced_at":"2025-07-17T10:33:56.926Z","repository":{"id":239201257,"uuid":"792544292","full_name":"manuelandersen/learn-git","owner":"manuelandersen","description":"Learning git by using git","archived":false,"fork":false,"pushed_at":"2024-07-11T02:14:24.000Z","size":256,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-10T04:50:14.443Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","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/manuelandersen.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}},"created_at":"2024-04-26T22:31:51.000Z","updated_at":"2024-07-11T02:06:43.000Z","dependencies_parsed_at":"2024-05-10T17:27:49.425Z","dependency_job_id":"2a12cd15-146d-437b-9349-db40b13c331f","html_url":"https://github.com/manuelandersen/learn-git","commit_stats":null,"previous_names":["manuelandersen/learn-git"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/manuelandersen/learn-git","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manuelandersen%2Flearn-git","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manuelandersen%2Flearn-git/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manuelandersen%2Flearn-git/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manuelandersen%2Flearn-git/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/manuelandersen","download_url":"https://codeload.github.com/manuelandersen/learn-git/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manuelandersen%2Flearn-git/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265595591,"owners_count":23794752,"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","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":"2024-11-14T01:08:49.270Z","updated_at":"2025-07-17T10:33:56.881Z","avatar_url":"https://github.com/manuelandersen.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Learning Git trough using Git\n\nSo, this is a github repo that im using to learn git and github.\n\n## First step\n\nWe use:\n\n```\ngit init \n```\n\nto initiate a git repository. This means that our local folder will be tracked by git.  \n\nThe second thing we do is go to github and create a repository. We use:\n\n```\ngit remote add origin url\n```\n\nwhere url is the url of the repository we just created.\n\nWe then create a python file called `first-file.py` and we just write in this a simple print:\n\n```python\nprint(\"This is the first file\")\n```\n\nwe use:\n\n```\ngit add .\n```\n\nto add this file to our repository. Then we use:\n\n```\ngit commit -m \"message\"\n```\nto commit this files we added to the repository. You need to write in `\"message\"` a concise description of what you commit. Then we use:\n\n```\ngit push origin master\n```\nto push our commit to the github repository. This changes will be in the `master` branch.\n\n### Checking what is going on\n\nAt any point you can do:\n\n```\ngit status\n```\nto now where the code you have write are in terms of git tracking.\n\nYou can also do:\n\n```\ngit log\n```\n\nto get a recor of all the changes and commits your code had over time. To exit this log just press `q`.\n\n# Making a new branch\n\nSometimes you want to work on some new feature or try a different version of your code, but dont want to change the code until you know that the feature works. So you make a \"copy\" of your actual code and work in that copy. This is called a new branch. Your make a new one by doing:\n\n```\ngit checkout -b new-branch\n```\n\nwhere `new-branch` is the name of the new branch you want to make. Then you can add and commit changes to this new branch the exact same way that for `master`. For pushing the changes to this `new-branch` you do:\n\n```\ngit push origin new-branch\n```\n\n# Pull request\n\nIf you push sucesfully your new branch, your repository in github will give you the chance to `Open a pull request`. A pull request is a proposal to merge a set of changes from one branch into another.\n\nOnce you open the pull request you will see something like this:\n\n![screenshot](imgs/pull-request.png)\n\nHere you can `Merge` the pull request, and all the commits from this `new-branch` will be added to the master branch. Once you make the merge, you will see something like this:\n\n![screenshot](imgs/merge-pull-request.png)\n\nAnd now you can safely delete the `new-branch` (because all of the commits from that branch is now in the master one).\n\n# Git pull\n\nNow that we just merge the `new-branch`, we can make:\n\n```\ngit checkout master\n```\nto go back to the master branch, and type:\n\n```\ngit pull origin master\n```\n\nto get the recents changes to our local machine.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanuelandersen%2Flearn-git","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmanuelandersen%2Flearn-git","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanuelandersen%2Flearn-git/lists"}