在看书 FlaskWeb开发:基于Python的Web应用开发实战 时,下载完源码后 git clone https://github.com/miguelgrinberg/flasky.git

试着 切换到 提交历史 1a, $ git checkout 1a,出现error:

fatal: Not a git repository (or any of the parent directories): .git

这个提示表明现在不在一个git repository目录下,需要切换到flasky下面:

$ pwd
/c/Users/dell/Documents/GitHub/flasky

然后执行即可:

$ git checkout 1a
Note: checking out '1a'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

git checkout -b <new-branch-name>

HEAD is now at 7e1e156... Chapter 1: initial version (1a)

dell@dell-PC ~/Documents/GitHub/flasky ((1a))

1、git tag -a 'tag1' -m '备注tag1' HEAD //在本地代码的地方新增一个标签
2、git push origin tag1 //把到这个标签的代码push到仓库中
3、git show tag1 //查看标签内容
4、git tag //查看有哪些标签
5、git tag -d tag1 //删除标签

Git跟其它版本控制系统一样,可以打标签(tag), 作用是标记一个点为一个版本号,如0.1.3, v0.1.7, ver_0.1.3.在程序开发到一个阶段后,我们需要打个标签,发布一个版本,标记的作用显而易见。

下面介绍一下打标签,分享标签,移除标签的操作命令。

打标签

    git tag -a 0.1.3 -m “Release version 0.1.3″

    详解:git tag 是命令

-a 0.1.3是增加 名为0.1.3的标签

        -m 后面跟着的是标签的注释

    打标签的操作发生在我们commit修改到本地仓库之后。完整的例子

        git add .

        git commit -m “fixed some bugs”

        git tag -a 0.1.3 -m “Release version 0.1.3″

分享提交标签到远程服务器上

    git push origin master

    git push origin --tags

    –tags参数表示提交所有tag至服务器端,普通的git push origin master操作不会推送标签到服务器端。

删除标签的命令

    git tag -d 0.1.3

删除远端服务器的标签

    git push origin :refs/tags/0.1.3

git: fatal: Not a git repository (or any of the parent directories): .git的更多相关文章

  1. fatal: Not a git repository (or any of the parent directories): .git

    $ git remote add origin https://github.com/heyuanchao/YouxibiClient.gitfatal: Not a git repository ( ...

  2. git错误:fatal: Not a git repository (or any of the parent directories): .git

    git错误:fatal: Not a git repository (or any of the parent directories): .git 我用git add file添加文件时出现这样错误 ...

  3. git远程库与本地联系报错fatal: Not a git repository (or any of the parent directories): .git

    在github上新建了一个仓库,然后相与本地的仓库联系起来 $ git remote add origin https://github.com/liona329/learngit.git fatal ...

  4. git status出现 fatal: Not a git repository (or any of the parent directories): .git

    fatal: Not a git repository (or any of the parent directories): .git 提示说没有.git这样一个目录,解决办法如下: git ini ...

  5. git远程库与本地联系报错:fatal: Not a git repository (or any of the parent directories): .git

    在github上新建了一个仓库,然后相与本地的仓库联系起来 $ git remote add origin https://github.com/lizhong24/mysite2.git fatal ...

  6. 【Git初探】Git中fatal: Not a git repository (or any of the parent directories): .git错误的解决办法

    今天用git bash更新项目时遇到了无论使用什么命令都会报fatal: Not a git repository (or any of the parent directories): .git的情 ...

  7. 初学git,出现错误:fatal: Not a git repository (or any of the parent directories): .git

    提示说没有.git这样一个目录,解决办法: 输入  git init 就可以啦.

  8. Error:fatal: Not a git repository (or any of the parent directories): .git

    在项目目录下执行git init命令. 大功告成.

  9. Git错误提示之:fatal: Not a git repository (or any of the parent directories): .git

    产生原因:一般是没有初始化git本地版本管理仓库,所以无法执行git命令 解决方法:操作之前执行以下命令行: git init 然后执行一下git status查看状态信息,good,问题解决.

随机推荐

  1. electron 入门小白贴

    electron 入门小白贴 electron demo 跑起来! 毕设准备是做个 跨平台的做题的客户端,打算用 electron 来弄. 然而今天折腾了半天才终于吧demo给跑起来了.经历了许多的问 ...

  2. VS2013编译google protobuf 出现问题error C3861: “min”:

    问题描述: 今天用vs2013编译protobuf 2.4.1 报错: 错误 3 error C3861: "max": 找不到标识符 f:\google\protobuf\pro ...

  3. List Map Set 的用法和区别

    参考 http://blog.csdn.net/vstar283551454/article/details/8682655

  4. Map工具系列-08-map控件查看器

    所有cs端工具集成了一个工具面板 -打开(IE) Map工具系列-01-Map代码生成工具说明 Map工具系列-02-数据迁移工具使用说明 Map工具系列-03-代码生成BySQl工具使用说明 Map ...

  5. 爬虫框架--webmagic

    官方有详细的使用文档:http://webmagic.io/docs/zh/ 简介:这只是个java爬虫框架,具体使用需要个人去定制,没有图片验证,不能获取js渲染的网页,但简单易用,可以通过xpat ...

  6. Linux问题处理: stdio.h: No such file or directory linux

    本来打算编译一下<自制编程语言>一书的代码,结果提示错误: 其实说的还是很清楚的,一般出现这种情况都是没有安装相应的库,所以: 再次编译,成功: 测试代码: # comment print ...

  7. ReactNative 使用微软的CodePush进行热更新,继续填坑

    1.别被开发环境骗了 在我们开发react native的时候,一键运行工程,js改了,只要cmd+R就可以刷新了.然后会轻易以为真正app上线的时候也是一样,只要app一打开就是最新的. 其实!这是 ...

  8. BZOJ3196: Tyvj 1730 二逼平衡树

    传送门 主席树的常数蜜汁优越,在BZOJ上跑了rnk1. 做法很简单,主席树套BIT. 1-3做法很简单,第四个和第五个做法转换成前两个就行了. //BZOJ 3196 //by Cydiater / ...

  9. 如何修改SharePoint2013服务器场帐号密码

    服务器远程登录帐号密码修改密码后,如何修改sharepoint服务器场管理员账户密码,今天登录了一下N久以前的搭建sharepoint2013服务器场的一台服务器器,登录进去以后直接提示帐号密码过期需 ...

  10. vm.max_map_count

    Virtual memoryedit Elasticsearch uses a hybrid mmapfs / niofs directory by default to store its indi ...