1、 拉取
1.1、拉取
git clone http://120.27.8.241/xxxx.git
2、提交
2.1、将文件添加到暂存区中
//提交所有文件到暂存区
git add --all
//提交文件或者文件夹到暂存区
git add <文件或者文件夹>
2.2、将暂存区修改内容添加到新的分支上
git commit -m “修改项目代码"
2.3、 提交到远程master
git push master
git push origin HEAD:refs/for/分支名
3、 打标签
3.1、 本地打标签
git tag -a B0009.0001.010a -m "this is V0009.0001.010a" <commit id>
3.3、 将所有标签推送到远端
git push origin --tags
4、查看所有分支
查看所有分支
git branch -a
5、切换分支
git checkout 分支名
git checkout remotes/origin/分支名
git checkout <commit id>
记得抄送给大家,需要有至少2个+1才能合并入库审核过了后就在ONES上发起提测,自测文档是在发提测的时候要上传到ONES上。
所有文件都要转化为utf-8格式。
6、commit id切换分支
git reset --hard commit id
7、 如果多条patch没有chang-id的话, 用如下命令进行一次性添加。
git rebase -i
8、执行commit后,还没执行push时,想要撤销这次的commit,该怎么办?
git reset --soft HEAD^
9、执行add后,还没执行commit时,想要撤销这次add,该怎么办?
git reset HEAD file
10、追加提交
git commit --amend --no-edit
11、 暂存工作区的修改和弹出工作区的修改
git stash
git clean -df
git stash pop
在nuttx系统上用的命令
git clean -df
git restore --staged SourceCode/ls_task/lte_at.h
git stash
git fetch
git rebase
git commit --amend --no-edit
git checkout -f ./
git reset HEAD^
git stash
git fetch
git rebase
git rebase --abort
git reset HEAD^
git checkout -f ./ 清除工作区
git clean -df 清除没有被关在的文件
git rebase
git stash pop
git status
git restore --staged SourceCode/ls_task/task_4g.c
git stash
git fetch
git rebase
git stash pop
git checkout master
追加
git commit --amend --no-edit
git push origin HEAD:refs/for/master
问题
解决办法