Thursday, July 20, 2017

Git command line instructions

Command line instructions

Git global setup
git config --global "Ranganayaki Sermoria"
git config --global "git registered email id"

Create a new repository
git clone "GIT URL"

cd stratesample
git add
git commit -m "add README"
git push -u origin master

Existing folder
cd existing_folder
git init
git remote add origin "GIT URL"

git add .
git commit
git push -u origin master

Existing Git repository

cd existing_repo
git remote add origin "GIT URL"
git push -u origin --all
git push -u origin --tags

Git commit in terminal opens VIM, but can't get back to terminal

To save your work and exit press Esc and then :wq (w for write and q for quit).
Alternatively, you could both save and exit by pressing Esc and then :x
To set another editor do export EDITOR=myFavoriteEdior

Get latest from GIT

 git fetch origin
 git checkout master
 git merge origin/master
Push latest into GIT
git push -u origin --all