alp*_*o20 -1 git terminal command-line
我在 YouTube 上观看了一个试图学习 Git 的教程,当我输入“git status”时,我得到了一堆我什至不知道自己拥有的未跟踪文件。它看起来像这样:(
use "git add/rm <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
deleted: HW5-master/.DS_Store
deleted: HW5-master/README.md
deleted: HW5-master/github_fork.png
deleted: HW5-master/solution/vltrees.py
deleted: HW5-master/variably_leafed_trees/instructions.mdown
deleted: HW5-master/variably_leafed_trees/vltrees.py
Untracked files:
(use "git add <file>..." to include in what will be committed)
.CFUserTextEncoding
.DS_Store
.Rapp.history
.Rhistory
.anaconda/
.bash_history
.bash_profile
.bash_profile-anaconda3.bak
.bash_profile.pysave
.bash_sessions/
.conda/
.condarc
.config/
.cups/
.ghc/
.gitconfig
.idlerc/
.ipynb_checkpoints/
.ipython/
.jupyter/
.matplotlib/
.oracle_jre_usage/
.python_history
.rstudio-desktop/
.spyder-py3/
.subversion/
.viminfo
.wing101-7
.wingpersonal6
.wingpersonal7
.zprofile
.zsh_history
Applications/
Creative Cloud Files/
Desktop/
Documents/
Downloads/
Library/
Movies/
Music/
Pictures/
Public/
Untitled.ipynb
VirtualBox VMs/
ccg-latex.zip
ccg-latex/
https:/
jagex_cl_oldschool_LIVE.dat
jagexappletviewer.preferences
jagexcache/
nltk_data/
opt/
random.dat
Run Code Online (Sandbox Code Playgroud)
我认识其中一些目录,但其他目录我从未见过。这是一个问题吗?我应该删除它们吗?如果是这样,如何?我不想不小心弄乱我的电脑。另外,我在哪里可以找到关于 Git 的好教程,YouTube 上的所有内容似乎都过于肤浅。
你git init在你的主目录中运行。这在您的主目录中创建了一个 Git 存储库,它涵盖了您的主目录和所有子目录中的所有内容。所有现有文件都“未跟踪”,直到您找到git add它们。
你可能不想那样。Git 将其所有信息存储在一个.git目录中,因此您可以通过删除~/.git/. 稍后您可能会尝试将所有点文件放入 Git 存储库。
如果要在特定目录中初始化 Git 存储库,请更改到该目录,然后更改git init, 或git init <the directory>.
我认识其中一些目录,但其他目录我从未见过。这是一个问题吗?我应该删除它们吗?
不,这不是问题。不,不要删除它们。
操作系统通常会隐藏某些对您的系统运行至关重要的重要“系统”文件和目录,以防止您意外修改或删除它们。通常这意味着.bash_profile像Library/. 它们值得研究以了解有关 Mac 工作方式的更多信息。
但https:/很可能是一个错误。
另外,我在哪里可以找到关于 Git 的好教程,YouTube 上的所有内容似乎都过于肤浅。
我推荐Scott Chacon 和 Ben Straub 的Pro Git。它是免费的而且非常好。
还有Github 的 Using Git。有些是 Github 特定的,但很多是通用的 Git 教程。
要了解 Git 的工作原理,请尝试我自己的Git For Ages 4 And Up。