{"id":22497361,"url":"https://github.com/alfaizkhan/cheat-sheet","last_synced_at":"2025-03-27T21:27:34.313Z","repository":{"id":144546082,"uuid":"175762313","full_name":"Alfaizkhan/Cheat-sheet","owner":"Alfaizkhan","description":"A basic commands for Github.","archived":false,"fork":false,"pushed_at":"2019-03-15T06:41:11.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-02T00:11:10.867Z","etag":null,"topics":["gitcheatsheet","github"],"latest_commit_sha":null,"homepage":"","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/Alfaizkhan.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":"2019-03-15T06:31:01.000Z","updated_at":"2019-03-15T06:43:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"ff37f381-ee9a-40bf-a6e8-df238f743314","html_url":"https://github.com/Alfaizkhan/Cheat-sheet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alfaizkhan%2FCheat-sheet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alfaizkhan%2FCheat-sheet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alfaizkhan%2FCheat-sheet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Alfaizkhan%2FCheat-sheet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Alfaizkhan","download_url":"https://codeload.github.com/Alfaizkhan/Cheat-sheet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245926403,"owners_count":20695046,"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":["gitcheatsheet","github"],"created_at":"2024-12-06T20:18:32.388Z","updated_at":"2025-03-27T21:27:34.284Z","avatar_url":"https://github.com/Alfaizkhan.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cheat-sheet\n\n# GIT Cheat Sheet\n\n \n\n## 1) init — Create an empty GIT repository in your development directory\n\nGo to directory\n\n#### git init\n \n\n\n## 2) status — Show the current state of the repository including un-added and un-committed files\n\n#### git status\n \n\n## 3) add — Add a file to the repository staging area\n\nCreate a file, e.g. file.txt\ngit add file.txt\nAdd all new or changed files to the repository staging area (the period means all)\n\n#### git add .\n \n\n\n## 4) commit — Commit all changes to the repository for first time (-m means message)\n\n#### git commit –m “Initial commit”\n\nCommit all changes to the repository for later activities\n\n#### git commit –m “Description of changes being made to project”\n \n\n\n## 5) branch — Create a new branch of the project\n\nChoose a name for the new branch (original branch is master), e.g. test\ngit branch test\nList all branches (* appears next to current branch)\n\n#### git branch\n \n\n\n## 6) checkout — Switch branches and check-out all files (e.g. to test branch)\n\ngit checkout test\nCreate a new branch and check-out files in one command\n\n#### git checkout –b test\n \n\n\n## 7) merge — Merge two branches together (go to the destination branch first, e.g. master)\n\n#### git checkout master\n#### git merge test\n \n\n\n## 8) delete — Delete a branch that you no longer need (e.g. after a merge)\n\n#### git branch test –d\n\nOr to force the delete:\n\n#### git branch test –D\n \n\n\n## 9) log — View commit history (including long commit ID numbers)\n\n#### git log\n \n\n\n## 10) revert — Revert all files back to a previous commit point\n\n#### git revert \u003clong commit ID from the log command\u003e\n\nRemoves cache from a specific file so that it can be added to the .gitignore\n#### rm -cache\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falfaizkhan%2Fcheat-sheet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falfaizkhan%2Fcheat-sheet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falfaizkhan%2Fcheat-sheet/lists"}