今天第一次使用了一下
先下载一个Git到本地。然后在想要放Git工程的地方,右键bash
然后是一些命令:
git clone <地址>
# 新建分支
git checkout -b <branch_name>
# 修改后
git add --all
git commit -m "some comments"
git push origin <branch_name>
# 删除分支
git branch -d <branch_name>
# 查看所有分支
git branch
# 不小心改了东西怎么办
git reset --hard head #慎用
git reset -- file_name #reset一个文件。
git diff 文件名
# 拉取远程分支到本地不存在的分支
git fetch origin Q3
git checkout -b Q3 origin/Q3
# push到远程新分支
git push origin local_name:new_name