1,首次打开Git shell错误(以前打开过gethub客户端)

警告: git command could not be found. Please create an alias or add it to your
PATH.
警告: Could not find ssh-agent

解决方法

1,close Git Shell,关闭Git Shell客户端
2,open GitHub and let it do some post installation. 这步骤是打开GitHub客户端,把里面的无效链接删除啥的,
3,Open Git Shell again and you should be fixed.打开Git Shell客户端。

参照地址:http://stackoverflow.com/questions/14950355/git-command-could-not-be-found-and-could-not-find-ssh-agent

2,在个人电脑f盘建git名文件夹,GitShell中 cd f:,cd git之后,在网站上new Repositoriy之后,copy项目地址,命令:

git clone https://github.com/lkdghzh/MyBackUp.git

3,git status的时候报错误,因为需要初始化:

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

解决办法:提示说没有.git这样一个目录。输入git init,之后git shell命令行开头就从F:\git>变成了F:\git [master +1 ~0 -0 !]>

解释:git status命令可以列出当前目录所有还没有被git管理的文件被git管理且被修改但还未提交(git commit)的文件

其实不对,我们需要继续cd respositiry的文件夹
如果不继续cd respositiry的文件夹的话,做了git init,在respositiry的文件夹的同级会多一个.git文件夹,
respositiry的文件夹的子文件夹还有一个.git,就不对了嘛~

clone之后的文件夹名是假如是demo,.git文件是在demo文件夹里面的。我们需要继续cd:demo,然后git status就不会报上述错误了!
这样的demo文件夹的文件(.html.css)、文件夹(js css)就下载下来了。

3.1Untracked files:git怎样删除未监视的文件untracked files

用 git clean

# 删除 untracked files
git clean -f

# 连 untracked 的目录也一起删掉
git clean -fd

# 连 gitignore 的untrack 文件/目录也一起删掉 (慎用,一般这个是用来删掉编译出来的 .o之类的文件用的)
git clean -xfd

# 在用上述 git clean 前,墙裂建议加上 -n 参数来先看看会删掉哪些文件,防止重要文件被误删
git clean -nxfd
git clean -nf
git clean -nfd

4,设置/查看用户名、邮箱

git config --global user.name "lkdghzh"
git config --global user.email "416960428@qq.com"

查看的时候把后面的用户名或者邮箱名去掉就ok

F:\git [master +2 ~0 -0 !]>
+ = Added files
~ = Modified files
- = Removed files
! = Conflicted files

后面数字我觉得应该是个数。

git 上传到网站中文编码

分支:

1查看本地分支

git branch

* master

2查看远程本地分支

git branch -a

* master
 remotes/origin/HEAD -> origin/master
 remotes/origin/master

3本地创建分支

git branch new_branch

git branch
* master
  new_branch

4本地分支推到远程分支

错误、警告

git add --a warning: LF will be replaced by CRLF in .idea/

//问题
$ git add --a
warning: LF will be replaced by CRLF in .idea/demo.iml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in .idea/encodings.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in .idea/misc.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in .idea/modules.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in .idea/vcs.xml.
The file will have its original line endings in your working directory.
warning: LF will be replaced by CRLF in .idea/workspace.xml.
The file will have its original line endings in your working directory.

//解决方案
git config core.autocrlf false

//会在.git文件夹(可能隐藏)的config文件,增加autocrlf = false。
[core]
    repositoryformatversion = 0
    filemode = false
    bare = false
    logallrefupdates = true
    symlinks = false
    ignorecase = true
    autocrlf = false
[remote "origin"]
    url = https://github.com/lkdghzh/demo.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    remote = origin
    merge = refs/heads/master
[branch "new_branch"]
    remote = origin
    merge = refs/heads/new_branch
//可能是解决编辑器(webstorm,pythoncharm)自带生成的文件,不会提交?

git push 时候fatal: The current branch new_branch has no upstream branch

$ git push
fatal: The current branch new_branch has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin new_branch

Git Shell使用笔记的更多相关文章

  1. git的学习笔记(二):git远程操作

    1.创建ssh key ssh-keygen -t rsa -C "your_email@example.com" 执行命令后会在用户的家目录生成.ssh的隐藏文件夹,文件夹里有公 ...

  2. GitHub for Windows 內建 Git Shell 執行時顏色所代表的意義

    在使用指令列版控的過程中,經常有機會用到 Git Shell 這套優異的 Git 版控環境,一來他使用 Windows PowerShell 為核心,其訊息顯示與輸入都支援 Unicode,比較不會有 ...

  3. 使用github的使用,利用git shell命令行模式进行操作

    一.登录到git,新建一个版本仓库 二.在"Repository name"一栏里填写版本仓库的名称,如"test",Description栏是描述,可填可不填 ...

  4. Learning The Bash Shell读书笔记(整理)

    最近搞了一本书 Learning Bash Shell,发现有人已经写了阅读笔记,我就在这边整理一下 来自blog:http://blog.sina.com.cn/n4mine Learning Th ...

  5. SHELL学习笔记----IF条件判断,判断条件

    SHELL学习笔记----IF条件判断,判断条件 前言: 无论什么编程语言都离不开条件判断.SHELL也不例外.  if list then           do something here   ...

  6. Shell编程笔记

    Shell编程笔记与Windows下熟悉的批处理类似,也可以将一些重复性的命令操作写成一个脚本方便处理.   修改别人的脚本,运行后遇到个问题 setenv: command not found 查证 ...

  7. shell学习笔记

    shell学习笔记 .查看/etc/shells,看看有几个可用的Shell . 曾经用过的命令存在.bash_history中,但是~/.bash_history记录的是前一次登录前记录的所有指令, ...

  8. Git Pro读书笔记

    本文为Git Pro读书笔记,所有内容均来自Git Pro 1 Git基础 1.1 记录每次更新到仓库 在Git里,文件有4种状态,modified, staged, commited, 还有一种状态 ...

  9. 如何利用git shell提交代码到github

    在很早之前我根据找到的一些资料以及自己的实践总结了一篇如何将VS2015上的代码上传到GitHub上,后来我发现有小伙伴私信我,说跟我上面写的不一样,但是那段时间也比较忙,当我发现有人私信的时候差不过 ...

随机推荐

  1. iOS7隐藏顶部状态栏

    找到工程中的Supporting Files/工程名-info.plist 添加设置 1.status bar is initially hidden=YES 2.View Controller-ba ...

  2. ubuntu14.04安装与配置nginx服务器

    去年曾经配置过nginx服务器,可惜的是,几个月前因故障磁盘被格式化.今天又要用到nginx服务,所以从新配置了一番,但这次就不是那么顺利了.在此,愿与大家分享一下经验.只是简单的局域网应用,并未复杂 ...

  3. 《Java程序性能优化》学习笔记 程序优化

    这一部分主要介绍代码层的优化.了解如何编写高效而精炼的代码,正确的使用函数方法.1.字符串优化处理Java语言中,String对象可以认为是对char数组的眼神和进一步封装.它主要由3部分组成:cha ...

  4. Android_就像小朋友“搭积木”一样。

    就像小朋友“搭积木”一样.感觉这句话很有意思.完整的话是这样的: Android提供了大量功能丰富的UI组件,开发者只要按一定规律把这些UI组件组合起来 --就像小朋友“搭积木”一样,把这些UI组件搭 ...

  5. matlab练习程序(图像马赛克)

    处理原理就是将邻域像素平均值赋给邻域中的所有像素. 这里将处理方法分为了带线条和不带线条,带线条处理后的视觉效果要好些. 原图: 处理结果(不带线条): 处理结果(带线条): 代码处理的是带线条的情况 ...

  6. 让html元素随浏览器的大小自适应垂直居中

    转自:http://www.cnblogs.com/linjiqin/archive/2011/06/15/2081362.html 表格可以实现td中的元素垂直居中显示,但是前提条件必须定义td的高 ...

  7. Unicode编码

    Unicode为世界上所有的文字系统的每一个字符单位分配了一个唯一的整数,称为代码点,范围为:0~1114111: ASCII将每一索引映射为唯一的二进制表示,但Unicode允许多个不同二进制编码的 ...

  8. 指示灯组与3个复位按钮的介绍Arduino Yun快速入门教程

    指示灯组与3个复位按钮的介绍Arduino Yun快速入门教程 1.4.2  指示灯组 指示灯组的放大图如图1.5所示. 图1.5  指示灯组 各个指示灯对应的功能如下: q  RX:对应于0号端口, ...

  9. jQuery检查某个元素在网页上是否存在

    jQuery选择器有比较完善的处理机制,用jQuery获取网页中不存在的元素也不会报错,值得注意的是,利用$('#tt')获取的永远是对象,即使网页上没有此元素.当使用jQuery检查某个元素在网页上 ...

  10. jQuery对表单、表格的操作及更多应用(下:其他应用)

    内容摘录自锋利的JQuery一书 三.其他应用  1 网页字体大小控制(P164) <span class="bigger">放大</span> <s ...