0

I'm quite new to github. Today I was in the path Desktop/Projects and I made a new directory in it:

mkdir CV

inside it a ran the command:

echo "# CV" > README.md

because I wanted to create a Readme file inside the CV directory and just writing in it # CV.

At this stage I wanted to add my files onto Github so I went on Github website and I created a new repo. Then back on the terminal, before doing anything else, I first checked git status and that's what it came up:

warning: could not open directory 'Pictures/Libreria di Foto.photoslibrary/': Operation not permitted On branch master

No commits yet

Untracked files: (use "git add ..." to include in what will be committed)

.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/

My computer is currently entire under untracked files. I did not do git init anywhere. I also tried to follow the steps following the answer in another stackoverflow topic but didn't work out.

Gtchweb
  • 49
  • 1
  • 8
  • On the contrary, you most likely *did* run git init, in your home folder. Then, you ran git status in your home folder. – Tom Lord Nov 18 '18 at 12:09
  • Delete the ~/.git/ folder, and then run git init from within the CV folder. – Tom Lord Nov 18 '18 at 12:10
  • I was in my path: ~ and just ran the command: rm -rf .git but now it looks like i deleted git from my mac. The "git" word on the terminal disappeared and if I try to run for instance git status it gives me this output: fatal: not a git repository (or any of the parent directories): .git – Gtchweb Nov 18 '18 at 12:18
  • Yeah guys I sorted it out. So I did rm -rf .git while I was in my ~ . After that I went on my CV folder and did git init. Everything back to normal. Thank you guys, super helpful. – Gtchweb Nov 18 '18 at 12:23

2 Answers2

0

Delete the ~/.git and you will be fine.

You accidentally executed git init in your home folder

CodeWizard
  • 128,036
  • 21
  • 144
  • 167
0

In addition to the answer "remove ~/.git", you can figure out where the .git folder is by executing git rev-parse.

It will return .git if you're at repository's root, if not it will return absolute path to the repository's .git folder.

ik1ne
  • 1,041
  • 15
  • 20