2020年7月30日星期四

Introduction Of Git Basic Command


  before git commit:
   git config --global user.email "username@example.com" 
   git config --global user.name "username"                       


…or create a new repository on the command line

echo "# testscript" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/lqwangxg/testscript.git
git push -u origin master
                

…or push an existing repository from the command line

git remote add origin https://github.com/lqwangxg/testscript.git
git push -u origin master

…or import code from another repository

You can initialize this repository with code from a Subversion, Mercurial, or TFS project.

…Change remote URL 

#check current URL before changing.
get remote get-url --all origin 
https://github.com/lqwangxg/beforestatus.git

#change origin URL
get remote set-url origin https://github.com/lqwangxg/test.git

#check current URL after changed.
get remote get-url origin 
https://github.com/lqwangxg/test.git

没有评论: