git: fatal: Not a git repository (or any of the parent directories): .git
在看书 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的更多相关文章
- 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 ( ...
- 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添加文件时出现这样错误 ...
- 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 ...
- 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 ...
- 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 ...
- 【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的情 ...
- 初学git,出现错误:fatal: Not a git repository (or any of the parent directories): .git
提示说没有.git这样一个目录,解决办法: 输入 git init 就可以啦.
- Error:fatal: Not a git repository (or any of the parent directories): .git
在项目目录下执行git init命令. 大功告成.
- Git错误提示之:fatal: Not a git repository (or any of the parent directories): .git
产生原因:一般是没有初始化git本地版本管理仓库,所以无法执行git命令 解决方法:操作之前执行以下命令行: git init 然后执行一下git status查看状态信息,good,问题解决.
随机推荐
- AngularJS表达式
1. AngularJS使用表达式把数据绑定到HTML. 2. AngularJS表达式的特点: 表达式写在双大括号内:{{表达式}}. 表达式把数据绑定到HTML,这与ng-bind指令有异曲同工之 ...
- Web Deploy自动配置
自动发布配置,需要在发布的配置文件里面添加以下一句,避免在发布时,无权限! <Project ToolsVersion="4.0" xmlns="http://sc ...
- 五.Jenkins安装plugin
http://blog.csdn.net/jmyue/article/details/9376237
- ssh 登录慢?
修改 /etc/ssh/sshd_config 文件中对应的配置为: GSSAPIAuthentication no UseDNS=no 修改 /etc/nsswitch.conf 文件中对应的配置为 ...
- sublime 插件推荐: Nettuts+ Fetch
Nettuts+ Fetch github地址:Nettuts-Fetch 在sublime中直接用 ctrl+shift+P -> pci -> Nettuts-Fetch 即可下载 这 ...
- eclipse运行没问题,tomcat以脚本启动后插入数据库的中文会乱码
记一次部署工程的时候遇到的问题 部署war包到win7的时候发现,布上去后插入数据库的中文会乱码,然后发现用eclipse运行源码没问题,一开始以为是war打出来的时候编码错误,然后将eclipse的 ...
- javaweb 基于java Servlet登入 简单入门案例
项目流程 第一步:创建一个java webproject第二步:创建三个界面,1,login.jsp 2 success.jsp 3 fail.jsp第三步:更改新建界面编码格式,utf-8 默然编码 ...
- CSS3的filter用法
最近到处看到有人在说CSS3的filter一直没有时间自己去测试这效果.今天终于抽出时间学习这个CSS3的Filter.不整不知道呀,一整才让我感到吃惊,太强大了.大家先来看个效果吧: 我想光看上面的 ...
- openstack资料相关
https://github.com/int32bit/openstack-workflow #openstack各种时序图 http://docs.openstack.org/developer/ ...
- IOS静态库
如何在Xcode中创建C++静态库 http://jingyan.baidu.com/article/03b2f78c111fca5ea237ae26.html iOS 如何创建和使用静态库 http ...