git常见命令

git的配置

git config --global user.name "[email protected]"

git config --global user.email "[email protected]"

从github上克隆git项目

git clone [email protected]:yuluoqianmu/test.git

cd test

添加README.md文件并推到github上

touch README.md

git add README.md

git commit -m "add README"

git push -u origin master

如果本地已经存在一个项目,则把该项目push到github

cd existing_folder

git init

git remote add origin [email protected]:yuluoqianmu/test.git

git add .

git commit

git push -u origin master

相关推荐