{"id":27129339,"url":"https://github.com/faizulislamfair/git_commands","last_synced_at":"2026-01-20T05:32:21.826Z","repository":{"id":98296157,"uuid":"430638341","full_name":"faizulislamfair/git_commands","owner":"faizulislamfair","description":"A repo for learning and recalling git commands!","archived":false,"fork":false,"pushed_at":"2024-05-19T13:43:58.000Z","size":16,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-07T19:46:24.838Z","etag":null,"topics":["git"],"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/faizulislamfair.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":"2021-11-22T09:17:44.000Z","updated_at":"2024-05-21T21:13:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"a70c9d1e-292f-4ca9-8c83-b97ac3ad06ac","html_url":"https://github.com/faizulislamfair/git_commands","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/faizulislamfair/git_commands","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faizulislamfair%2Fgit_commands","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faizulislamfair%2Fgit_commands/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faizulislamfair%2Fgit_commands/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faizulislamfair%2Fgit_commands/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/faizulislamfair","download_url":"https://codeload.github.com/faizulislamfair/git_commands/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faizulislamfair%2Fgit_commands/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28596427,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T02:08:49.799Z","status":"ssl_error","status_checked_at":"2026-01-20T02:08:44.148Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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"],"created_at":"2025-04-07T19:43:39.539Z","updated_at":"2026-01-20T05:32:21.800Z","avatar_url":"https://github.com/faizulislamfair.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Git Commands\n\n\u003cdiv align='center'\u003e\n\u003cimg alt=\"Git\" width=\"300px\" src=\"git.png\" /\u003e\n\u003c/div\u003e\n\n\u003cbr\u003e\n\n## To setup username globally\n### git config --global user.name \"username\"\n\n\u003cbr\u003e\n\n## To setup email globally\n### git config --global user.email \"email\"\n\n\u003cbr\u003e\n\n## To change username globally\n### git config --global user.name \"username\"\n\n\u003cbr\u003e\n\n## To change email globally\n### git config --global user.email \"email\"\n\n\u003cbr\u003e\n\n## To check if the setup is complete\n### git config --list\n\n\u003cbr\u003e\n\n## To exit the list \n### press 'q'(just q)\n\n\u003cbr\u003e\n\n## To see the username\n### git config user.name\n\n\u003cbr\u003e\n\n## To see the email\n### git config user.email\n\n\u003cbr\u003e\n\n## To delete branch locally,\n### git branch -D branch_name\n\n\u003cbr\u003e\n\n## To delete branch remotely,\n### git push origin --delete branch_name\n\n\u003cbr\u003e\n\n\n## To download latest changes from a remote repository to local machine\n### git fetch \n\n\u003cbr\u003e\n\n## To integrate changes from one branch into another\n### git checkout branch_to_merge_into \n### git merge branch_to_merge_from \n\n\u003cbr\u003e\n\n\n## To download latest changes from a remote repository to local machine and integrate into current branch (git fetch + git merge)\n### git pull\n\n\u003cbr\u003e\n\n\n## To remove a specific staged file (only added/staged, not committed) or unstage\n### git rm --cached file_name(with extension) \u003cbr\u003e\nor, \u003cbr\u003e\n### git reset file_name(with extension)\n\n\u003cbr\u003e\n\n\n\n## To remove all unstaged changes and move head to specific point\n### git reset commit_id\n\n\u003cbr\u003e\n\n## To remove all staged and unstaged changes and move head to specific point\n### git reset --hard commit_id\n\n\u003cbr\u003e\n\n## To remove all staged files (only added/staged, not committed) or unstage\n### git reset HEAD\n\n\u003cbr\u003e\n\n## To remove all staged changes (even from files) and staged files(only added/staged, not committed) or unstage\n### git reset --hard HEAD\n\n\u003cbr\u003e\n\n## To exit from git log press 'q' (just q)\n\n\u003cbr\u003e\n\n## To view all commits with ids in a clean way \n### git log --pretty=oneline\n\n\u003cbr\u003e\n\n## To view all commits with ids in a clean way (shorter version)\n### git log --oneline\n\n\u003cbr\u003e\n\n## To display changes between a specific commit and current head\n### git diff commit_id\n \n\u003cbr\u003e \n\n\n## To abort merge after getting conflict message\n### git merge --abort\n\n\u003cbr\u003e\n\n\n## To not lose changes by not committing yet and moving to another branch to work on something\n### git stash \u003cbr\u003e\nor, \u003cbr\u003e \n### git stash -u \u003cbr\u003e\nand then to apply changes after coming back later \u003cbr\u003e\n### git stash apply index_number(0)\n\n\u003cbr\u003e\n\n## To save stash with a custom message\n### git stash push -m \"message_name\"\n\n\u003cbr\u003e\n\n## To change name of most recent commit that hasn't been pushed to remote repo yet\n### git commit --amend -m \"new commit message\"\n\n\u003cbr\u003e\n\n## To change name of most recent commit that has been pushed to remote repo\n### git commit --amend -m \"new commit message\"\n### Plus\n### git push --force\n\n\u003cbr\u003e\n\n## To forcefully revert back to the state of the latest commit, discarding any local changes and disregarding any conflicts or warnings\n\n### git checkout HEAD~ --force\n\n\u003cbr\u003e\n\n\n## To move HEAD to a particular commit, push to repo and pull to master branch\n\n### git checkout commit_id\n### git add .\n### git commit -m \"commit message\"\n### git push origin HEAD:master --force\n### Plus\n### git checkout master\n### git pull \n\n\u003cbr\u003e\n\n\n## To bring in changes from a specific commit \n\n## To bring in changes from one commit and commit directly in my branch\n\n### git cherry-pick commit_id \n\n\nor, \u003cbr\u003e\n\n\n## To bring in changes from more than one commit and commit directly in my branch\n\n### git cherry-pick commit_id_one commit_id_two \n\n\n## To bring in changes from one commit and without committing directly in my branch\n\n### git cherry-pick commit_id -n\n\nthen commit, \u003cbr\u003e\n\n### git commit -m \"commit_name\"\n\n\u003cbr\u003e\n\n\n## To undo changes introduced in a previous commit and commit\n### git revert commit_id\n### Plus\n### :q (to exit)\n\n\u003cbr\u003e\n\n\n## To replay all commits on our current branch on top of specified branch\n### git rebase branch_name\n\n## To edit commit history before rebasing\n### git rebase -i branch_name\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaizulislamfair%2Fgit_commands","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffaizulislamfair%2Fgit_commands","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaizulislamfair%2Fgit_commands/lists"}