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,问题解决.
随机推荐
- websocket初探
本文尚未完成,在此只写一些句子,以后慢慢整理. 一.参数 IllegalArgumentException No payload parameter present on the method[mes ...
- Dao跨事务调用实现转账功能
1.首先在数据库当中创建数据库,并且创建它的 实现类 package com.beiwo.epet.entity; public class Account { private int id; pri ...
- 微信小程序-关于重定向问题
关于微信的重定向问题 wx.redirectTo(OBJECT) 参数 参数 类型 必填 说明 url 串 是 需要跳转的应用内页面的路径 成功 功能 否 接口调用成功的回调函数 失败 功能 否 接口 ...
- CSS Icon 项目地址 小图标-用css写成的
http://cssicon.space/#/icon/focus 这是所有用css写成的 小图标 右侧有 html和css代码
- asp.net mvc 权限过滤和单点登录(禁止重复登录)
1.权限控制使用controller和 action来实现,权限方式有很多种,最近开发项目使用控制控制器方式实现代码如下 /// <summary> /// 用户权限控制 /// < ...
- iOS之UITableView组头组尾视图/标题悬停
最近笔者在公司的iOS开发中,有一个iOS开发同事跑来问了两个问题:1.给UITableView设置了组头和组尾视图,但是一直显示不出来?2.UITableView的section的header和fo ...
- SqlServer中使用正则表达式
一.查看配置,如果‘show advanced options’,‘Ole Automation Procedures’,‘Ad Hoc Distributed Queries’的config_val ...
- linux设置定时备份mysql数据库
最近写自己的项目,买了阿里云服务器,可以在云上根据自己想到的需求随意使用技术,感觉很爽.备份mysql流程如下: 环境:CentOS Linux release 7.2.1511 (Core) mys ...
- 定制sqlmap tamper脚本
前言 渗透测试过程中遇到注入点常常丢到sqlmap中进行测试,假如网站有waf,sqlmap便无法直接注入了. 测试 在测试某个项目的过程中,一个页面的aid参数,习惯性的提交 and 1=1发现直接 ...
- 真正解决vbox不能为虚拟电脑打开一个新任务的解决方法
今天小编电脑上出现了一个问题,如上图,经过了一个朋友的帮助终于问题解决了,解决方法: 在每一个中把 红框中打上勾号即可