github仓库的创建请看:https://www.linuxidc.com/Linux/2017-11/148628.htm
仓库的创建做一下记录:
点击右上角settings -> SSH and GPG keys -> new sshkeys
在ubuntu下运行:
ssh-keygen -t rsa -C "[email protected]"
cd /root/.ssh
这里就有一个id_rsa 和id_rsa.pub文件
将id_rsa.pub的内容复制到仓库new_keys即可
1 删除远程仓库的文件夹
git rm -r --cached test
git commit -m "删除test文件夹"
git push
2 创建并切换到develop分支
git checkout -b develop
3 查看所在分支
git branch
4 添加文件到分支
添加文件:
git add test/test.txt
加入分支:
git commit -m "添加test.txt文件"
上传分支到远程仓库:
git push origin develop
5 查看修改情况
git log
commit ec4751a3914199a1cd8bf686493e0b6701f9086e (HEAD -> develop, origin/develop)
6 版本回退
回退到上一个版本
git reset --hard
指定退到某个版本
git reset --hard ec4751a(版本的commit ID 前几位)
7 创建一个git项目