git简单操作

配置用户名和邮箱地址

git config --global user.name "xxxxx"
git config --global user.email "xxxxxx@xx.com

生成ssh key

ssh-keygen -t rsa -C "youremail@xx.com"

初始化仓库

git init

将文件添加到缓存

git add hello.txt
git add .

查看在你上次提交之后是否有修改

git status 

将缓存区内容添加到仓库中

git commit -m "add hello.txt"

-m :为操作添加注释

连接远程仓库

git remote add origin "URL"
git remote add origin "git@github.com:GoAllTheWay/Test.git"

删除已连的远程

git remote rm origin

查看已连接的远程库信息

git remote -v

从远程获取最新版本并合并到本地

git pull origin master

将本地的master分支推送到origin主机

git push origin master

连接GitHub

ssh -T git@github.com

拷贝一个 Git 仓库到本地

git clone "URL"
get clone "git@github.com:GoAllTheWayWpt/Test.git"

创建分支命令

git branch (branchname)

切换分支命令

git checkout (branchname)

合并分支命令

git merge 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值