The Git command takes me out of the current directory to the parent directory

I have a problem with git. When I execute the command, it pushes me out of the working directory and into the parent directory. This happens a little more often, perhaps 25% of any git command

So, I'll do something line by line:

$user at ubuntu-machine in /var/www/project/name: git add .
$user at ubuntu-machine in /var/www/project/name: git commit -m "Git message"
$user at ubuntu-machine in /var/www/project/name: fatal: Not a git repository

      

I am currently running Ubuntu 16.04 with git version 2.7.4.

Has anyone else had this problem? Possible reasons why this is happening?

Any help is appreciated, thanks

+3


source to share


2 answers


I solved the problem by upgrading from 2.7.4 to 2.11.0



sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get upgrade git git-man

      

+2


source


this looks good to me as long as you initialize the directory .... if not then ... you must initialize your directory first: git init



0


source







All Articles