Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git command moves me out of current directory into parent directory

Tags:

git

bash

ubuntu

I've been having an issue with git. When I execute a command it will push me out of the working directory and into the parent directory. This happens somewhat frequently, maybe 25% of any git command

So I will do something along the lines:

$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'm currently running Ubuntu 16.04 with git version 2.7.4.

Has anyone else had this issue? Possible reasons why it's happening?

Any help is appreciated, thanks

like image 709
fppz Avatar asked Jan 30 '26 14:01

fppz


1 Answers

I resolved my issue by updating 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
like image 89
fppz Avatar answered Feb 02 '26 03:02

fppz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!