So I've been trying to create a text file using Git, I punched in the command "touch home.html", then I punched in the command git "add home.html", then I input "git status" and the file doesn't want to appear, I have relaunched the finder multiple times, nothing.
MacOS – Files created by Terminal are not visible in the Finder
command linegitinvisible-filesmacos
Best Answer
You're running
git status
in the wrong repository (your home directory,~
, i.e./Users/adam
). You need to move into the repo that you want to act on, i.e.cd ~/Desktop/Tools/Git/MyFolder
, or a subdirectory of this, and then rungit status
.You've created the
home.html
file in~
.You must have run
git init
on your home directory or a parent of it, i.e./Users/adam
,/Users
, or/
. The first is most likely, as the others would require use ofsudo
. You can forget about / get rid of this repo by runningrm -rf .git
within that directory.I encourage you to learn the basics of Git by watching this video.
Here's a good video on Linux terminal basics as well. macOS isn't Linux, but it's Unix-based, just like Linux, so the principles are the same; the knowledge directly applies to macOS.