Linux下git的初步使用

这里写图片描述

  • 下载安装

sudo yum install git

  • 需要同步的文件夹内操作,初始化git仓库空间。

git init
使用 ll -a 查看,文件夹内多了个.git

  • 添加当前目录的所有文件到暂存区(理解为本地仓库)

git add .

  • 提交注释语,以及提交到本地仓库-a

git commit -am “first commit docker”

  • 初次使用会提示设置邮箱,用户名

config –global user.email “[email protected]
git config –global user.name “Tom”

  • 添加远程仓库地址

git remote add origin https://github.com/woshilinqin/docker-tomcat.git
使用命令git remote -v查看有多少个地址

  • 推送到远程地址

git push -u origin master

猜你喜欢

转载自blog.csdn.net/qq_35830949/article/details/79693984