{"id":20198482,"url":"https://github.com/uudashr/git-intro","last_synced_at":"2025-03-03T08:24:49.729Z","repository":{"id":142323361,"uuid":"85159925","full_name":"uudashr/git-intro","owner":"uudashr","description":"Introduction to Git","archived":false,"fork":false,"pushed_at":"2017-03-16T08:32:22.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-13T19:48:24.700Z","etag":null,"topics":["git","tutorial"],"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/uudashr.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":"2017-03-16T06:20:00.000Z","updated_at":"2017-03-16T08:25:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"de4ab070-81c8-43d9-bfc8-35e92cda9495","html_url":"https://github.com/uudashr/git-intro","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uudashr%2Fgit-intro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uudashr%2Fgit-intro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uudashr%2Fgit-intro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uudashr%2Fgit-intro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uudashr","download_url":"https://codeload.github.com/uudashr/git-intro/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241631262,"owners_count":19993994,"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":["git","tutorial"],"created_at":"2024-11-14T04:31:39.546Z","updated_at":"2025-03-03T08:24:49.708Z","avatar_url":"https://github.com/uudashr.png","language":null,"readme":"# Short intro to Git\n\n## Git setup (first time only)\n\nFirst time only\n\n```shell\n# set global config\ngit config --global user.name \"Nuruddin Ashr\"\ngit config --global user.email \"uudashr@gmail.com\"\n\n# list global config\ngit config -l --global\n```\n\n\n\nor for specific project\n\n```shell\n# set local config\ngit config --local user.name \"Nuruddin Ashr\"\ngit config --local user.email \"nuruddin@kurio.co.id\"\n\n# list local config\ngit config -l --local\n```\n\n## Create repository\n\n### Github first\n\n```shell\n# TODO go to github.com and create repository\ngit clone https://github.com/uudashr/git-intro.git\ncd git-intro\n```\n\n\n\n### Local first\n\n```shell\n# TODO create README.md with some content\n\ngit init\ngit add README.md\ngit commit -m \"Added README.md\"\ngit remote add origin https://github.com/uudashr/git-intro.git\ngit push -u origin master\n```\n\n\n\n## Ignoring files (.gitignore)\n\nIf we want something to ignore by the git\n\n**file:** *.gitignore*\n\n```\n.DS_store\ntemp\nTODO.txt\n```\n\n## Make some changes\n\n```shell\n# TODO make some change to README.md\ngit status\ngit add README.md\n\n# check again the status\ngit status\ngit commit -m \"Made some changes to the README.md\"\ngit push\n```\n\nor add new file\n\n```shell\n# TODO create new file story.txt\n\ngit status\ngit add story.txt\n\n# check again the status\ngit status\ngit commit -m \"Add our first story\"\ngit push\n```\n\n\n\n## Branching\n\n### Listing branch\n\n```shell\ngit branch\n```\n\n\n\n### Create branch\n\n```shell\ngit branch \u003cbranch-name\u003e\n```\n\n\n\nor create branch and checkout (switch)\n\n```shell\ngit checkout -b \u003cbranch-name\u003e\n```\n\n\n\n### Switching between branch\n\n```shell\ngit checkout \u003cbranch-name\u003e\n```\n\n\n\n### Merging branch\n\n```shell\ngit checkout master\ngit merge \u003cbranch-name\u003e\n```\n\n\n\n### Deleting (local) branch\n\n```shell\ngit branch -d \u003cbranch-name\u003e\n```\n\n\n\n### Pushing (local) branch to remote repo\n\n```shell\ngit push -u origin \u003cbranch-name\u003e\n```\n\n\n\n### Deleting remote branch\n\n```shell\ngit push origin --delete \u003cbranch-name\u003e\n```\n\nor\n\n```shell\ngit branch -dr origin/\u003cbranch-name\u003e\n```\n\n\n\n## Tagging\n\n```shell\ngit tag \u003ctag-name\u003e\n```\n\n\n\npush to remote\n\n```shell\ngit push origin \u003ctag-name\u003e\n```\n\nor\n\n```shell\ngit push --tags\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuudashr%2Fgit-intro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuudashr%2Fgit-intro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuudashr%2Fgit-intro/lists"}