-1

I was watching a tutorial on YouTube trying to learn Git, and when I typed in "git status" I got a bunch of untracked files that I wasn't even aware I had. It looks something like this: (

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

I recognize some of these directories, but others I have never seen. Is this a problem? should I delete them? If so, how? I don't want to accidentally mess with my computer. Also, where could I find a good tutorial on Git, everything on YouTube seems too superficial.

Ente
  • 2,301
  • 1
  • 16
  • 34
alpablo20
  • 342
  • 1
  • 15
  • 3
    Looks like you initialized your home directory. You should not delete any of those files until you know what they are for. – William Pursell Jul 27 '20 at 22:35
  • Or, you might add the file to git and then delete it and experiment with what happens. It could be a good learning experience, and you can recover the file from git when you discover why you need it. – William Pursell Jul 27 '20 at 22:36
  • 2
    But note that "good learning experience" does not mean it doesn't have the potential to be incredibly frustrating. :) – William Pursell Jul 27 '20 at 22:37

1 Answers1

7

You ran git init in your home directory. This created a Git repository in your home directory which covers everything in your home directory and all the subdirectories. All the existing files are "untracked" until you git add them.

You probably don't want that. Git stores all its information in a .git directory, so you can get rid of this repository by deleting ~/.git/. Later you might try putting all your dotfiles into a Git repository.

If you want to initialize a Git repository in a specific directory, either change to that directory and then git init, or git init <the directory>.

I recognize some of these directories, but others I have never seen. Is this a problem? should I delete them?

No, it is not a problem. No, do not delete them.

Operating systems often hide certain important "system" files and directories vital for your system to run from you to prevent you from accidentally modifying or deleting them. Often that means dotfiles like .bash_profile or directories like Library/. They're worth looking into to understand more about how your Mac works.

But https:/ is probably a mistake.

Also, where could I find a good tutorial on Git, everything on YouTube seems too superficial.

I recommend Pro Git by Scott Chacon and Ben Straub. It's free and very good.

Also Github's Using Git. Some is Github specific, but a lot is general Git tutorials.

To understand how Git works, try my own Git For Ages 4 And Up.

Schwern
  • 153,029
  • 25
  • 195
  • 336