-
1 :创建一个简单的本地工程
-
2 : cd到你创建工程的目录下,然后执行命令
git init
-
3 : 执行你创建工程的相关指令
- 1
git status
: (命令可以列出当前目录所有还没有被git管理的文件和被git管理且被修改但还未提交文件)
- 1
-
2
git add
. : (他会监控工作区的状态树,使用它会把工作时的所有变化提交到暂存区) -
3
git commit -m "都写了啥"
: (提交本地代码改动的备注) -
4 : 然后创建远程代码仓库(例如:https://coding.net)
-
5 : 添加远程仓库关联 :
git remote add origin 远程仓库地址
(HTTPS/SSH) -
6 :提交代码到远程仓库 :
git push origin master

-
出现错误的主要原因是github中的README.md文件不在本地代码目录中
-
可以通过如下命令进行代码合并【注:pull=fetch+merge]
git pull --rebase origin master
-
7 : 再次提交即可成功 :
git push origin master
本地打标签备份, 并提交标签
- 查看命令 :
git tag
- "打"tag :
git tag '0.0.1'
- "推"tag :
git push --tags
删除本地/远程标签
- 删除本地
git tag -d 0.0.1
- 删除远程
git push origin :0.0.1
重新设置用户名和密码
https://coding.net/u/CoderST/p/DemoTest/git
git remote set-url origin https://CoderST@git.coding.net/CoderST/test.git
网友评论