{"id":23031515,"url":"https://github.com/eramitgupta/git-commands","last_synced_at":"2025-10-16T06:59:20.825Z","repository":{"id":246934557,"uuid":"824689686","full_name":"eramitgupta/git-commands","owner":"eramitgupta","description":"Git Commands including basic to advanced commands🔥","archived":false,"fork":false,"pushed_at":"2024-07-05T18:19:57.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-07-05T23:14:24.572Z","etag":null,"topics":["command-line","git","gitcommands","github","github-config"],"latest_commit_sha":null,"homepage":"","language":null,"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/eramitgupta.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-05T17:39:21.000Z","updated_at":"2024-07-05T23:14:29.435Z","dependencies_parsed_at":"2024-07-05T23:14:27.225Z","dependency_job_id":null,"html_url":"https://github.com/eramitgupta/git-commands","commit_stats":null,"previous_names":["eramitgupta/git-commands"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eramitgupta%2Fgit-commands","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eramitgupta%2Fgit-commands/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eramitgupta%2Fgit-commands/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eramitgupta%2Fgit-commands/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eramitgupta","download_url":"https://codeload.github.com/eramitgupta/git-commands/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229840719,"owners_count":18132554,"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":["command-line","git","gitcommands","github","github-config"],"created_at":"2024-12-15T15:38:33.367Z","updated_at":"2025-10-16T06:59:15.771Z","avatar_url":"https://github.com/eramitgupta.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"Git Commands\n============\n\n## Translated Versions\n- [Versão em português](READMEpt.md)\n- [Versión en español](READMEes.md)\n- [Türkçe versiyon](READMEtr.md)\n- [বাংলা সংস্করণ](READMEbn.md)\n- [हिन्दी अनुवाद](READMEhi.md)\n- [العربية](READMEar.md)\n\n---\n\n*A list of commonly used Git commands from basic to advanced*\n\n### Getting \u0026 Creating Projects\n| Command | Description |\n| ------- | ----------- |\n| `git init` | Initialize a local Git repository |\n| `git clone ssh://git@github.com/[username]/[repository-name].git` | Create a local copy of a remote repository |\n| `git clone [url]` | Clone a repository using HTTPS or SSH |\n\n### Basic Snapshotting\n| Command | Description |\n| ------- | ----------- |\n| `git status` | Check status |\n| `git add [file-name.txt]` | Add a file to the staging area |\n| `git add -A` | Add all new and changed files to the staging area |\n| `git commit -m \"[commit message]\"` | Commit changes |\n| `git commit -am \"[commit message]\"` | Add and commit in one step |\n| `git rm [file-name.txt]` | Remove a file |\n| `git rm -r [file-name.txt]` | Remove a file (or folder) |\n| `git mv [old-file-name.txt] [new-file-name.txt]` | Rename a file |\n\n### Branching \u0026 Merging\n| Command | Description |\n| ------- | ----------- |\n| `git branch` | List branches (the asterisk denotes the current branch) |\n| `git branch -a` | List all branches (local and remote) |\n| `git branch [branch name]` | Create a new branch |\n| `git branch -d [branch name]` | Delete a branch |\n| `git branch -D [branch name]` | Force delete a branch |\n| `git push origin --delete [branch name]` | Delete a remote branch |\n| `git checkout -b [branch name]` | Create a new branch and switch to it |\n| `git checkout [branch name]` | Switch to a branch |\n| `git checkout -` | Switch to the branch last checked out |\n| `git checkout -- [file-name.txt]` | Discard changes to a file |\n| `git merge [branch name]` | Merge a branch into the active branch |\n| `git merge --no-ff [branch name]` | Merge a branch into the active branch with a merge commit |\n| `git stash` | Stash changes in a dirty working directory |\n| `git stash list` | List stashed changes |\n| `git stash apply` | Apply the latest stashed changes |\n| `git stash apply stash@{n}` | Apply specific stashed changes |\n| `git stash clear` | Remove all stashed entries |\n\n### Sharing \u0026 Updating Projects\n| Command | Description |\n| ------- | ----------- |\n| `git push origin [branch name]` | Push a branch to your remote repository |\n| `git push -u origin [branch name]` | Push changes to remote repository (and remember the branch) |\n| `git push` | Push changes to remote repository (remembered branch) |\n| `git push origin --delete [branch name]` | Delete a remote branch |\n| `git pull` | Update local repository to the newest commit |\n| `git pull origin [branch name]` | Pull changes from remote repository |\n| `git fetch` | Fetch all branches from remote repository |\n| `git fetch origin` | Fetch all branches from remote repository |\n| `git remote add origin ssh://git@github.com/[username]/[repository-name].git` | Add a remote repository |\n| `git remote set-url origin ssh://git@github.com/[username]/[repository-name].git` | Set a repository's origin branch to SSH |\n\n### Inspection \u0026 Comparison\n| Command | Description |\n| ------- | ----------- |\n| `git log` | View changes |\n| `git log --summary` | View changes (detailed) |\n| `git log --oneline` | View changes (briefly) |\n| `git log --graph --oneline` | View changes as a graph |\n| `git diff` | Show changes between commits, commit and working tree, etc. |\n| `git diff [source branch] [target branch]` | Preview changes before merging |\n| `git diff --staged` | Show changes between staged changes and the last commit |\n| `git show [commit]` | Show various objects (blobs, trees, commits, tags) |\n| `git blame [file]` | Show what revision and author last modified each line of a file |\n\n### Advanced Commands\n| Command | Description |\n| ------- | ----------- |\n| `git rebase [branch]` | Reapply commits on top of another base tip |\n| `git rebase -i [commit]` | Start an interactive rebase |\n| `git cherry-pick [commit]` | Apply the changes introduced by some existing commits |\n| `git revert [commit]` | Revert a commit by making a new commit |\n| `git reset [commit]` | Reset your current branch to a specific commit |\n| `git reset --hard [commit]` | Reset and discard all changes to a specific commit |\n| `git reset --soft [commit]` | Reset to a specific commit, but keep changes staged |\n| `git reflog` | Show a log of changes to the local repository's HEAD |\n| `git clean -f` | Remove untracked files from the working tree |\n| `git clean -fd` | Remove untracked files and directories |\n| `git bisect start` | Start a binary search to find a commit that introduced a bug |\n| `git bisect bad` | Mark the current commit as bad |\n| `git bisect good [commit]` | Mark a known good commit |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feramitgupta%2Fgit-commands","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feramitgupta%2Fgit-commands","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feramitgupta%2Fgit-commands/lists"}