https://github.com/sudheerpal/git_commands
A list of command which are used very often.
https://github.com/sudheerpal/git_commands
git git-stash gitconfig version-control
Last synced: over 1 year ago
JSON representation
A list of command which are used very often.
- Host: GitHub
- URL: https://github.com/sudheerpal/git_commands
- Owner: sudheerpal
- Created: 2017-02-16T18:26:29.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-22T21:14:29.000Z (over 9 years ago)
- Last Synced: 2025-01-21T15:28:20.118Z (over 1 year ago)
- Topics: git, git-stash, gitconfig, version-control
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Git_Commands version 2
A list of command which are used very often.
## Git Clone
git clone http://repo-url
## Git Configuation
git config --global user.name 'Sudheer Pal'
git config --global user.email 'sudheerpal2@gmail.com' ('local' can be used in place of 'global' in case your want local git configuration)
## Git Initiate
git init (it initiate git inside project)
## Git Add Files
git add -A (stages All files incluing new, modified and deleted)
git add . (stages new and modified, without deleted)
git add -u (stages modified and deleted, without new)
git add fileName (in case you want to add a single file only)
git add *.html (this will add all html file)
## Git Remove Files
git rm --cached fileName
## Git Commit
git commit -m 'your comment'
## Git Status
git status (all files should be in green, if not then add using below command)
## Git Adding remote repository
git remote add origin https://github.com/sudheerpal/Git_Commands.git (adding for first time)
git remote get-url origin (checking current remote URL)
git remote set-url origin https://github.com/sudheerpal/Git_Commands.git (to set/change git remote to different URL)
## Git Push
git push -u origin master (for the first time, when publishing code to remote repo)
git push (can be used later)
## Git Pull
git pull (to pull any chnages from remote origin)
## Git Stash
git stash (making a backup of your changes, before pulling)
git stash apply (apply the changes, after new git pull)
git stash drop (discarding the changes, after new git pull)
## Git Branching
git branch branchName (creates a new branch)
git checkout branchName (moves index to new branch)
git merge branchName (its merges a branch to master branch, IMP. please make sure, you checkout to master branch before merging.)