{"id":18295431,"url":"https://github.com/spiderpig86/gitstuffdone","last_synced_at":"2025-10-08T05:57:47.098Z","repository":{"id":108440218,"uuid":"100818504","full_name":"Spiderpig86/GitStuffDone","owner":"Spiderpig86","description":":blue_book: Common git commands simplified.","archived":false,"fork":false,"pushed_at":"2017-09-02T21:23:03.000Z","size":8,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-15T02:43:20.281Z","etag":null,"topics":["cheatsheet","git","git-cheatsheet","git-guide","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/Spiderpig86.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-08-19T20:04:33.000Z","updated_at":"2024-08-17T02:53:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"f3b1937b-587b-46a9-9ecc-2ba181737f2a","html_url":"https://github.com/Spiderpig86/GitStuffDone","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/Spiderpig86%2FGitStuffDone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Spiderpig86%2FGitStuffDone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Spiderpig86%2FGitStuffDone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Spiderpig86%2FGitStuffDone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Spiderpig86","download_url":"https://codeload.github.com/Spiderpig86/GitStuffDone/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248002587,"owners_count":21031629,"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":["cheatsheet","git","git-cheatsheet","git-guide","github"],"created_at":"2024-11-05T14:35:24.001Z","updated_at":"2025-10-08T05:57:42.073Z","avatar_url":"https://github.com/Spiderpig86.png","language":null,"readme":"# GitStuffDone\nSimple git reference for when I forget.\n\n## :tada: Creating Repositories\n* `git init` - create a new repo\n* `git clone \u003crepo url\u003e \u003cfolder name\u003e` - download a project to a custom folder\n* `git status` - check repo status\n\n## :date: Repo History\n* `git log` - display commit ID (SHA), author, date, and commit message\n* `j`(up), `k`(down), `q`(exit) - scrolling through commit history\n* `git log --stat` - view modified files\n* `git log -p` or `git diff` - view file changes in commit\n* `git log -p --stat` - view both modified files and file chanegs\n* `git show \u003cSHA id\u003e` - view file changes of specific SHA id\n* `git show SHAid --state` - view modified files of specific SHA\n* `git log --stat \u003cSHA id\u003e` - view specific commit by ID\n\n## :heavy_plus_sign: Adding\n* `git add .` - add all files in current directory to stage\n* `git add \u003cfile names with space as delimiter\u003e` - add specific files to stage\n* `git add -u` - add all tracked files\n\n## :pushpin: Committing\n* `git commit -m \u003cmessage\u003e` - write a commit message without using the text editor\n    * Guideline: https://udacity.github.io/git-styleguide/\n* `git commit` - write commit message with text editor opened\n* `git commit -a` - directly add files to the repo without going through staging\n\n## :scissors: GitIgnore\n* Note: Assumes that VSCode is installed.\n##### Linux / OSX / GitBash\n1. Run `touch .gitignore` to create a file\n2. Run `code .gitignore` to open and edit\n\n##### Windows Powershell\n1. Run `New-Item .gitignore -type file` to create a file\n2. Run `code .gitignore` to open and edit\n\n##### Windows CMD\n1. Run `copy NUL .gitignore` to create a file\n2. Run `code .gitignore` to open and edit\n\n## :tropical_fish: Tagging\n* `git tag` - check version of tag in command line\n* `git tag -a \u003ctag name\u003e` - write a message for a specific version of the file\n* `git log --decorate` - show the current branch and tag version\n* `git tag -d \u003ctag name\u003e - delete tag version\n* `git tag -a \u003ctag name\u003e \u003cSHA id\u003e` - add a tag for a specific commit by SHA id.\n\n## :herb: Branching\n* `git branch` - show current branch\n* `git branch \u003cbranch name\u003e` - create a new branch\n* `git checkout \u003cexisting branch name\u003e` - switch to another branch\n* `git log --oneline --decorate` - display current active branch with SHA id and commits only\n* `git branch -d \u003cbranch name\u003e` - delete branch by name\n* `git checkout -b \u003cbranch name\u003e` - create new branch and switch to it\n* `git checkout -b \u003cbranch name\u003e master` - create a new branch in the same location as the master branch and switch to it\n* `git log --oneline --decorate --graph --all` - display all branches in folder\n\n## :page_with_curl: Merging\n* `git reset --hard HEAD^` - undo branch merge\n* `git merge \u003cbranch name\u003e` - merge branch by name\n\n## :heavy_check_mark: Correcting\n* `git commit --amend` - correct commit details in branch\n* `git revert \u003cSHA id\u003e` - revert changes up to commit specified by id\n\n## :milky_way: Remote\n* `git remote add origin \u003crepo url\u003e` - add a remote url for the repository\n* `git remote set-url origin \u003crepo url\u003e` - set a specific url for the repository\n* `git remote -v` - check the push and pull locations\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspiderpig86%2Fgitstuffdone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspiderpig86%2Fgitstuffdone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspiderpig86%2Fgitstuffdone/lists"}