{"id":21205346,"url":"https://github.com/sudheerpal/git_commands","last_synced_at":"2025-03-14T23:09:21.224Z","repository":{"id":91362571,"uuid":"82212419","full_name":"sudheerpal/Git_Commands","owner":"sudheerpal","description":"A list of command which are used very often.","archived":false,"fork":false,"pushed_at":"2017-02-22T21:14:29.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-21T15:28:20.118Z","etag":null,"topics":["git","git-stash","gitconfig","version-control"],"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/sudheerpal.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-02-16T18:26:29.000Z","updated_at":"2017-02-23T20:31:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"02da1e71-e53f-4f88-aece-eb4bf8cfc49f","html_url":"https://github.com/sudheerpal/Git_Commands","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/sudheerpal%2FGit_Commands","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudheerpal%2FGit_Commands/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudheerpal%2FGit_Commands/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sudheerpal%2FGit_Commands/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sudheerpal","download_url":"https://codeload.github.com/sudheerpal/Git_Commands/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243658270,"owners_count":20326467,"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":["git","git-stash","gitconfig","version-control"],"created_at":"2024-11-20T20:44:02.715Z","updated_at":"2025-03-14T23:09:21.203Z","avatar_url":"https://github.com/sudheerpal.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Git_Commands version 2\nA list of command which are used very often.\n\n## Git Clone\ngit clone http://repo-url\n\n## Git Configuation\ngit config --global user.name 'Sudheer Pal'\n\ngit config --global user.email 'sudheerpal2@gmail.com'   ('local' can be used in place of 'global' in case your want local git configuration)\n\n\n\n## Git Initiate\ngit init   (it initiate git inside project)\n\n\n\n\n## Git Add Files\n\ngit add -A    (stages All files incluing new, modified and deleted)\n\ngit add .     (stages new and modified, without deleted)\n\ngit add -u    (stages modified and deleted, without new)\n\ngit add fileName  (in case you want to add a single file only)\n\ngit add *.html  (this will add all html file)\n\n\n## Git Remove Files\ngit rm --cached fileName\n\n\n\n## Git Commit\ngit commit -m 'your comment'\n\n\n\n\n## Git Status\ngit status   (all files should be in green, if not then add using below command)\n\n\n\n\n## Git Adding remote repository\ngit remote add origin https://github.com/sudheerpal/Git_Commands.git      (adding for first time)\n\ngit remote get-url origin                                                  (checking current remote URL)\n\ngit remote set-url origin https://github.com/sudheerpal/Git_Commands.git  (to set/change git remote to different URL)\n\n\n\n\n## Git Push\ngit push -u origin master    (for the first time, when publishing code to remote repo)\ngit push      (can be used later)\n\n\n\n\n## Git Pull\ngit pull    (to pull any chnages from remote origin)\n\n\n\n\n## Git Stash\ngit stash (making a backup of your changes, before pulling)\n\ngit stash apply (apply the changes, after new git pull)\n\ngit stash drop  (discarding the changes, after new git pull)\n\n\n## Git Branching\ngit branch branchName    (creates a new branch)\n\ngit checkout branchName  (moves index to new branch)\n\ngit merge branchName     (its merges a branch to master branch, IMP. please make sure, you checkout to master branch before merging.)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsudheerpal%2Fgit_commands","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsudheerpal%2Fgit_commands","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsudheerpal%2Fgit_commands/lists"}