Thursday, December 25, 2014

GIT Commands

1. How to setup git clone for the first time?
Open git bash terminal and run the following commands
git config --global user.email "YOUR_GIT_PROJECT_CONFIGURED_EMAIL_ID"
git config --global user.name "YOUR_NAME"
mkdir /d/git/YOUR_DIRECTORY_NAME
cd /d/git/YOUR_DIRECTORY_NAME
git init
git remote add origin GIT_URL
git pull origin  master

2. How to work on existing git project?
Modify any file or directory in your local git repository
cd/d/git/YOUR_DIRECTORY_NAME
git status
git commit -m 'VALID_COMMENT'
git push -u origin master

3. How to check the current status of your local git repository?
git status

4. How to remove existing remote git repository?
git remote rm origin

5. How to add a new remote git repository?
git remote add origin GIT_URL

No comments:

Post a Comment