{"id":23689769,"url":"https://github.com/amanyadav0007/git-and-github-commands","last_synced_at":"2026-05-15T22:32:25.072Z","repository":{"id":270220346,"uuid":"909675963","full_name":"Amanyadav0007/Git-and-GitHub-Commands","owner":"Amanyadav0007","description":"Git and GitHub Commands list","archived":false,"fork":false,"pushed_at":"2024-12-29T13:08:18.000Z","size":3,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-29T06:56:33.882Z","etag":null,"topics":["git","github","readme"],"latest_commit_sha":null,"homepage":"https://www.instagram.com/curious_coder_aman/","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/Amanyadav0007.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-12-29T13:05:27.000Z","updated_at":"2024-12-30T10:52:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"63934d75-6c68-4908-8726-85cea091a78f","html_url":"https://github.com/Amanyadav0007/Git-and-GitHub-Commands","commit_stats":null,"previous_names":["amanyadav0007/git-and-github-commands"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Amanyadav0007/Git-and-GitHub-Commands","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Amanyadav0007%2FGit-and-GitHub-Commands","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Amanyadav0007%2FGit-and-GitHub-Commands/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Amanyadav0007%2FGit-and-GitHub-Commands/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Amanyadav0007%2FGit-and-GitHub-Commands/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Amanyadav0007","download_url":"https://codeload.github.com/Amanyadav0007/Git-and-GitHub-Commands/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Amanyadav0007%2FGit-and-GitHub-Commands/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278486610,"owners_count":25995006,"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","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","github","readme"],"created_at":"2024-12-30T01:39:17.838Z","updated_at":"2025-10-05T17:23:22.494Z","avatar_url":"https://github.com/Amanyadav0007.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Git-and-GitHub-Commands\n\nThis table provides a comprehensive list of commonly used Git and GitHub commands, categorized for easy reference.\n\n| **Category**              | **Command**                           | **Description**                                                                 |\n|---------------------------|---------------------------------------|---------------------------------------------------------------------------------|\n| **Setup and Configuration** | `git --version`                     | Check installed Git version.                                                   |\n|                           | `git config --global user.name \"Your Name\"` | Set your Git username.                                                         |\n|                           | `git config --global user.email \"your.email@example.com\"` | Set your Git email address.                                                    |\n|                           | `git config --list`                  | View all Git configurations.                                                   |\n|                           | `git help \u003ccommand\u003e`                 | Get help for a specific Git command.                                           |\n| **Starting a Repository** | `git init`                           | Initialize a new Git repository.                                               |\n|                           | `git clone \u003crepo-URL\u003e`               | Clone a remote repository to your local machine.                               |\n| **Staging and Committing** | `git add \u003cfile\u003e`                    | Stage a specific file.                                                         |\n|                           | `git add .`                          | Stage all changes in the repository.                                           |\n|                           | `git status`                         | Show the status of changes (staged, unstaged, untracked).                      |\n|                           | `git commit -m \"message\"`            | Commit staged changes with a descriptive message.                              |\n|                           | `git commit --amend`                 | Edit the last commit message.                                                  |\n| **Branching**             | `git branch`                         | List all branches in the repository.                                           |\n|                           | `git branch \u003cbranch-name\u003e`           | Create a new branch.                                                           |\n|                           | `git checkout \u003cbranch-name\u003e`         | Switch to a specific branch.                                                   |\n|                           | `git checkout -b \u003cbranch-name\u003e`      | Create and switch to a new branch.                                             |\n|                           | `git branch -d \u003cbranch-name\u003e`        | Delete a branch locally.                                                       |\n| **Merging**               | `git merge \u003cbranch-name\u003e`            | Merge a branch into the current branch.                                        |\n|                           | `git merge --abort`                  | Abort a merge in case of conflicts.                                            |\n| **Viewing Changes**       | `git log`                            | View the commit history.                                                       |\n|                           | `git log --oneline`                  | View the commit history in one-line format.                                    |\n|                           | `git diff`                           | Show unstaged changes.                                                         |\n|                           | `git diff \u003cbranch1\u003e \u003cbranch2\u003e`       | Compare two branches.                                                          |\n| **Undoing Changes**       | `git reset \u003cfile\u003e`                   | Unstage a file.                                                                |\n|                           | `git reset --hard`                   | Reset to the last commit, discarding all changes.                              |\n|                           | `git checkout -- \u003cfile\u003e`             | Discard changes in a file.                                                     |\n| **Working with Remotes**  | `git remote -v`                      | List remote repositories.                                                      |\n|                           | `git remote add origin \u003crepo-URL\u003e`   | Link a local repository to a remote repository.                                |\n|                           | `git push -u origin main`            | Push the main branch to the remote repository and set upstream.                |\n|                           | `git pull origin main`               | Fetch and merge changes from the remote repository's main branch.              |\n|                           | `git fetch`                          | Download changes from a remote repository without merging.                     |\n| **Tagging**               | `git tag`                            | List all tags in the repository.                                               |\n|                           | `git tag \u003ctag-name\u003e`                 | Create a new tag.                                                              |\n|                           | `git push origin \u003ctag-name\u003e`         | Push a specific tag to the remote repository.                                  |\n| **Collaborative Work**    | `git stash`                          | Save uncommitted changes for later.                                            |\n|                           | `git stash pop`                      | Apply the latest stashed changes and remove them from the stash list.          |\n|                           | `git stash list`                     | View the list of stashes.                                                      |\n|                           | `git rebase \u003cbranch-name\u003e`           | Reapply commits from another branch on top of the current branch.              |\n| **Cleanup**               | `git clean -f`                       | Remove untracked files.                                                        |\n| **Additional Commands**   | `git show \u003ccommit-hash\u003e`             | Show details of a specific commit.                                             |\n|                           | `git blame \u003cfile\u003e`                   | View who last edited each line of a file.                                      |\n|                           | `git cherry-pick \u003ccommit-hash\u003e`      | Apply a specific commit from one branch to another.                            |\n\n## Notes\n- Replace placeholders like `\u003crepo-URL\u003e`, `\u003cfile\u003e`, `\u003cbranch-name\u003e`, `\u003ctag-name\u003e`, and `\u003ccommit-hash\u003e` with your specific values.\n- Use the `--help` option with any Git command to get detailed information about its usage, e.g., `git commit --help`.\n\n---\n\nFeel free to use this table as a quick reference for your Git and GitHub commands!\nFollow @curious_coder_aman on Instagram for more coding updates.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famanyadav0007%2Fgit-and-github-commands","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famanyadav0007%2Fgit-and-github-commands","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famanyadav0007%2Fgit-and-github-commands/lists"}