LinuxLinux学习之路

CentOS7 & Ubuntu & Debia

2019-07-27  本文已影响1人  爱学习的蹭蹭

1 Git 简介

2 git 的作用

3 git安装命令

3.1、CentOS安装git

yum install git -y 或者
yum install -y git

3.2、 Ubuntu/Debian安装git

apt-get install git  -y

4 git常见命令

4.1 Git全局设置

git config --global user.name "admin"
git config --global user.email "admin@example.com"

4.2 创建一个仓库

git clone ssh://git@192.168.1.235:7003/root/springboot.git
cd springboot
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master

4.3 推送现有文件夹

cd existing_folder
git init
git remote add origin ssh://git@192.168.1.235:7003/root/springboot.git
git add .
git commit -m "Initial commit"
git push -u origin master

4.4 推送到现有的Git存储库

cd existing_repo
git remote rename origin old-origin
git remote add origin ssh://git@192.168.1.235:7003/root/springboot.git
git push -u origin --all
git push -u origin --tags

5 推荐学习

上一篇 下一篇

猜你喜欢

热点阅读