标签:mic sof star reset 目录 content lan leaves ota
1. 直接提交文件对于git 在本地版本库中已有的文件,可以不用执行“git add”操作,直接将工作区的文件提交到版本库(非index区)
$ git commit -m "pages/mainContent.html" pages/mainContent.html
[master 78b06dc] pages/mainContent.html
1 file changed, 40 insertions(+), 31 deletions(-)
$ git log --graph --pretty=oneline --abbrev-commit
* a12f1eb add bin/gateway.json
* 89c8f7c modify ../reportFrontend/routes/reports.js
* 78b06dc pages/mainContent.html
* 7851316 modify /iomsSimulator/pages/css/mainContent.css
* 7f85e95 deleted
* 5d8906b Merge remote-tracking branch ‘iomssimu/master‘
|| * bcf6f18 Create README.md
| * e955bb0 Merge branch ‘master‘ of https://github.com/solarkai/IomsSimu
| || * | 3692d9d commit microservice-discovery-service1 dir
| /
* | 1ec31f7 added
* | 30aeb18 deleted Please enter the commit message for your changes. Lines starting
* | fadbdf7 modified
* | 01e298f deleted
* | a5752be deleted
* | 8760c94 deleted Please enter the commit message for your changes. Lines starting
* | b4981ab delete
* | 5a8f6c6 commit
|/
* 537d116 commit reportfrontend dir
* c49f89a commit iomssimulator dir
根据“git log”命令获取到回退目标的位置,如下示例:
$ git reset --hard 89c8f7c
命令格式为“git reset [<mode>] [<commit>]”。请注意,这里的几个mode参数:
误删工作区的文件后,可以将版本库中的当前分支的当前版本恢复到工作区,如下命令示例(gateway.json文件被不小心删除):
$ git checkout reportFrontend/bin/gateway.json
定义和管理github上的远程仓库。
$ git remote add iomssimu https://github.com/solarkai/IomsSimu.git
$ git remote
iomssimu
$ git remote get-url iomssimu
https://github.com/solarkai/IomsSimu.git
$ git remote set-url iomssimu https://github.com/solarkai/IomsSimu.git
修改原目录名称“reportFrontend”为“reportMicrogateway”。
$ git mv -f reportFrontend reportMicrogateway
$ git commit -m "change reportFrontend 2 reportMicrogateway"
[master 9341f77] change reportFrontend 2 reportMicrogateway
$ git push iomssimu master
Fatal: HttpRequestException encountered.
Username for ‘https://github.com‘: solarkai
Counting objects: 2, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 274 bytes | 0 bytes/s, done.
Total 2 (delta 1), reused 0 (delta 0)
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
To https://github.com/solarkai/IomsSimu.git
a12f1eb..9341f77 master -> master
标签:mic sof star reset 目录 content lan leaves ota
原文地址:http://blog.51cto.com/solarboy/2160614