git - Git状态命令-未跟踪文件下的整台计算机
问题描述
我对 github 很陌生。今天我在路径 Desktop/Projects 中,并在其中创建了一个新目录:
mkdir 简历
在里面运行命令:
echo "# CV" > README.md
因为我想在 CV 目录中创建一个自述文件并在其中写入 #CV.
在这个阶段,我想将我的文件添加到 Github,所以我去了 Github 网站并创建了一个新的 repo。然后回到终端,在做任何其他事情之前,我首先检查了 git status ,结果就是这样:
警告:无法打开目录 'Pictures/Libreria di Foto.photoslibrary/':在分支主机上不允许操作
还没有提交
未跟踪的文件:(使用“git add ...”来包含将要提交的文件)
.CFUserTextEncoding
.DS_Store
.adobe/
.atom/
.bash_history
.bash_profile
.bash_sessions/
.bashrc
.bundle/
.cache/
.config/
.cups/
.dropbox/
.gem/
.gitconfig
.gnupg/
.irb-history
.local/
.mkshrc
.oh-my-zsh/
.oracle_jre_usage/
.profile
.rvm/
.ssh/
.subversion/
.swp
.viminfo
.zcompdump-MacBook Air di Emanuele-5.3
.zlogin
.zoomus/
.zsh_history
.zshrc
.zshrc.pre-oh-my-zsh
Applications/
Creative Cloud Files/
Desktop/
Documents/
Downloads/
Dropbox/
Library/
Movies/
Music/
Parallels/
Pictures/
Public/
myFile
my_final_project/
我的电脑目前是完整的未跟踪文件。我没有在任何地方做 git init 。我还尝试按照另一个 stackoverflow 主题中的答案的步骤进行操作,但没有成功。
解决方案
除了答案“删除~/.git
”之外,您还可以.git
通过执行git rev-parse
.
如果您位于存储库的根目录,它将.git
返回,否则它将返回存储库.git
文件夹的绝对路径。
推荐阅读
- c++ - 生成所有具有 n 个节点的无向图
- laravel - Laravel Model::all(); cannot retrieve data from table
- c# - 向我们的网络应用程序发送匿名请求
- ruby - Sinatra 中的 Cors 定义
- c# - 无法加载文件或程序集 'System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' 或其依赖项之一
- node.js - 从 firebase 功能上传到存储的图像无法在 firebase 控制台和浏览器上预览
- javascript - 如何在服务人员中编辑请求 url?
- c# - SOAP 响应必须绑定到模型
- ios - 通过 tcp 套接字流式传输 PCM 音频
- isabelle - Isabelle/HOL 关于元组集的问题