关于git的常用命令

命令行指令

git全局设置
git config --global user.name "fengtianyuan"
git config --global user.email "[email protected]"
创建一个新存储库
git clone [email protected]:dev/gitcoin.git
cd gitcoin
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master
现有文件夹
cd existing_folder
git init
git remote add origin [email protected]:dev/gitcoin.git
git add .
git commit -m "Initial commit"
git push -u origin master
现有的Git存储库
cd existing_repo
git remote rename origin old-origin
git remote add origin [email protected]:dev/gitcoin.git
git push -u origin --all

git push -u origin --tags

将本地的项目上传至Gitlab

输入下面的命令

git config --global user.name "椰子"
git config --global user.email "[email protected]"
git init
git remote add origin ssh://[email protected]:10022/tyshawn/sdap1.git
git add .
git commit -m "程序源代码"
git push -u origin master

猜你喜欢

转载自blog.csdn.net/qq_32364939/article/details/80175584
今日推荐