Git error fatal not a git repository or any of the parent directories git

This command works to get the files and compile them: git clone a-valid-git-url for example: git clone git://cfdem.git.sourceforge.net/gitroot/cfdem/liggghts However, git status (or any other git

This command works to get the files and compile them:

git clone a-valid-git-url

for example:

git clone git://cfdem.git.sourceforge.net/gitroot/cfdem/liggghts

However, git status (or any other git command) then gives the above fatal: Not a git repository (or any of the parent directories) error.

What am I doing wrong?

Michael Durrant's user avatar

asked Aug 14, 2012 at 22:14

Kevin Kostlan's user avatar

Kevin KostlanKevin Kostlan

3,1797 gold badges28 silver badges33 bronze badges

1

You have to actually cd into the directory first:

$ git clone git://cfdem.git.sourceforge.net/gitroot/cfdem/liggghts
Cloning into 'liggghts'...
remote: Counting objects: 3005, done.
remote: Compressing objects: 100% (2141/2141), done.
remote: Total 3005 (delta 1052), reused 2714 (delta 827)
Receiving objects: 100% (3005/3005), 23.80 MiB | 2.22 MiB/s, done.
Resolving deltas: 100% (1052/1052), done.

$ git status
fatal: Not a git repository (or any of the parent directories): .git
$ cd liggghts/
$ git status
# On branch master
nothing to commit (working directory clean)

answered Aug 14, 2012 at 22:19

Michael Durrant's user avatar

Michael DurrantMichael Durrant

92k94 gold badges319 silver badges483 bronze badges

2

I just got this message and there is a very simple answer before trying the others. At the parent directory, type git init

This will initialize the directory for git. Then git add and git commit should work.

Syden's user avatar

Syden

8,3255 gold badges26 silver badges45 bronze badges

answered Jan 10, 2017 at 21:40

Bill's user avatar

2

In my case, was an environment variable GIT_DIR, which I added to access faster.

This also broke all my local repos in SourceTree :(

answered Oct 2, 2015 at 9:15

lucasvc's user avatar

lucasvclucasvc

7371 gold badge11 silver badges34 bronze badges

2

Sometimes its because of ssh. So you can use this:

git clone https://cfdem.git.sourceforge.net/gitroot/cfdem/liggghts

instead of:

git clone git://cfdem.git.sourceforge.net/gitroot/cfdem/liggghts

answered Dec 19, 2016 at 3:44

Umit Kaya's user avatar

Umit KayaUmit Kaya

5,6913 gold badges38 silver badges52 bronze badges

1

in my case, i had the same problem while i try any git — commands (eg git status) using windows cmd. so what i do is after installing git for window https://windows.github.com/
in the environmental variables, add the class path of the git on the «PATH» varaiable. usually the git will installed on C:/user/"username"/appdata/local/git/bin add this on the PATH in the environmental variable

and one more thing on the cmd go to your git repository or cd to where your clone are on your window usually they will be stored on the documents under github

cd Document/Github/yourproject

after that you can have any git commands

EricSchaefer's user avatar

EricSchaefer

24.8k21 gold badges69 silver badges101 bronze badges

answered Aug 11, 2014 at 17:41

keyo's user avatar

git clone https://github.com/klevamane/projone.git
Cloning into 'projone'...
remote: Counting objects: 81, done.
remote: Compressing objects: 100% (66/66), done.
remote: Total 81 (delta 13), reused 78 (delta 13), pack-reused 0
Unpacking objects: 100% (81/81), done.

you have to «cd projone»

then you can check status.


One reason why this was difficult to notice at first, i because you created a folder with the same name already in your computer and that was where you cloned the project into, so you have to change directory again


Andre Figueiredo's user avatar

answered Aug 30, 2017 at 6:31

Onengiye Richard's user avatar

This error got resolved when I tried initialising the git using git init . It worked

answered Jan 26, 2019 at 21:51

Roopal's user avatar

I had another problem. I was in a git directory, but got there through a symlink. I had to go into the directory directly (i.e. not through the symlink) then it worked fine.

answered Aug 14, 2014 at 16:56

Frank Conry's user avatar

Frank ConryFrank Conry

2,6133 gold badges28 silver badges34 bronze badges

If Existing Project Solution is planned to move on TSF in VS Code:

open Terminal and run following commands:

  1. Initialize git in that folder (root Directory)

    git init

  2. Add Git

    git add .

  3. Link your TSf/Git to that Project — {url} replace with your git address

    git remote add origin {url}

  4. Commit those Changes:

    git commit -m "initial commit"

  5. Push — I pushed code as version1 you can use any name for your branch

    git push origin HEAD:Version1

answered Jun 17, 2020 at 8:46

Khushboo Tahir's user avatar

In my case, the original repository was a bare one.

So, I had to type (in windows):

mkdir   dest
cd dest
git init
git remote add origin avalidyetbarerepository
git pull origin master

To check if a repository is a bare one:

git rev-parse --is-bare-repository 

answered Aug 9, 2017 at 10:34

Madlozoz's user avatar

MadlozozMadlozoz

3274 silver badges15 bronze badges

Simply, after you clone the repo you need to cd (change your current directory) to the new cloned folder

git clone https://User_Name@bitbucket.org/Repo_Name.git

cd Repo_Name

answered Jul 10, 2017 at 13:16

Abdallah Okasha's user avatar

I suddenly got an error like in any directory I tried to run any git command from:

fatal: Not a git repository: /Users/me/Desktop/../../.git/modules/some-submodule

For me, turned out I had a hidden file .git on my Desktop with the content:

gitdir: ../../.git/modules/some-module

Removed that file and fixed.

answered Oct 4, 2018 at 19:39

Mikael Finstad's user avatar

i have the same problem from my office network.
i use this command but its not working for me
url,
so like this:
before

$ git clone https://gitlab.com/omsharma/Resume.git

After i Use this URL : $ git clone https://my_gitlab_user@gitlab.com/omsharma/Resume.git

try It.

answered Apr 19, 2019 at 5:49

Om Prakash Sharma's user avatar

In my case I was dealing with github workflow jobs and simply forgot to checkout the repo before my step. Adding pre requisite step actions/checkout@v2 resolved the issue.

answered Dec 12, 2022 at 6:31

Amir Chatrbahr's user avatar

A Git repository is a collection of files and information regarding past changes made in them. While working with Git, you may encounter errors that seem confusing, especially if you are a beginner and the terms used are not familiar to you. In this article, we will explore what causes, how to prevent, and how to solve the fatal: not a git repository error.

Table of Contents:

  1. What is the “fatal: not a git repository” error?
  2. What causes “fatal: not a git repository”?
  3. Solving “fatal: not a git repository”
  4. Preventing “fatal: not a git repository”
  5. How do Git repositories work?
    a. Stage the files
    b. Commit the changes
    c. Push the code
  6. What are some common Git errors?
    a. Permission Denied
    b. Failed to Push Some Refs
    c. fatal: A branch named <branch-name> already exists.
    d. Can’t switch between branches
  7. What causes Git errors?
  8. Conclusion

What is the “fatal: not a git repository” error?

Most of the Git commands must be executed against a Git repository. For example, if you run git push -u origin master outside of a git repository, Git will simply not know what to push and where to push. The error above, fatal: not a git repository (or any of the parent directories): .git, states that you tried to execute a repository-specific command, outside of the Git repository. Fortunately, even if it is a very common problem, it is also very easy to solve.

fatal not a git repository

What causes “fatal: not a git repository”?

The fatal: not a git repository error makes it clear that you’re not in a git repository, but the reason you’re not in such a repository may be one of two:

1. You tried to run the command but did not navigate to the project folder where the git repository is located.

2. You are in the project directory, but you didn’t initialize the Git repository for that project folder.

Solving “fatal: not a git repository”

Let’s refer back to the previous section where we discussed the two situations in which one gets a fatal: not a git repository error. To solve the first situation, check the folder in which you are currently trying to run the command again.

Is that the correct folder? If not then simply use the cd command to navigate to the correct path.

There is a simple trick that you can use to be sure that you always open a command prompt in the correct folder. Navigate to the project directory using the file explorer and then type in the search bar, cmd. This will open a command prompt to the current folder path.

The trick for always opening a command prompt in the correct folder

The trick for always opening a command prompt in the correct folder

For the second situation, you need to initialize the Git repository in your project folder. To do so, you need to navigate to the correct folder and then run the command git init, which will create a new empty Git repository or reinitialize an existing one.

Preventing “fatal: not a git repository”

When you run a Git command, the first step Git will take is to determine the repository you are in. To do this, it will go up in the file system path until it finds a folder called .git. Basically, the repository starts with the directory that has a .git folder as a direct child.

To prevent the fatal:not a git repository error, you need to make sure that you are in a Git repository before running any commands. One way you can do this is to check for the existence of the .git folder.

That period in front of the .git folder means that it’s a hidden folder. Therefore, it will not appear in the file explorer unless you have explicitly set it to show hidden folders.

On Windows, you can do this from the iew tab.

Enable hidden items in Windows from View tab

Enable hidden items in Windows from the View tab

If you are on Linux or you use a console emulator that allows you to execute Linux commands, you can run the ls command with the flag -a to lists all files including hidden ones.

Linux command to list all files

Linux command to list all files

Another quick solution that you can use to check that you are inside a Git repository is to run the git status command. This command will show the current state of the repository if the current folder is part of a Git repository.

How do Git repositories work?

Git errors can be confusing, especially if you’re a beginner. This confusion mainly occurs because users are taught to create a connection between problem and solution, where someone encounters a problem and then looks for and uses a solution generally valid without trying to understand too much about the cause of the problem

This simple problem-solution connection is enough for most issues on Git: clone a repository, write some code, commit the changes and push the commits; or clone a repository, create a new branch, write some code, merge the branches and solve the conflicts. However, learning how Git works and its basic concepts will help you understand the technology you are working with and even do much more than those simple use cases described above.

Here’s some basic information to help you better understand how Git repositories work.

First and foremost, Git is a Distributed Version Control System (DVCS). With Git, we have a remote repository stored on a third-party server and a local repository stored in our local computer. Therefore, one can find the code in more than one place. Instead of having just one copy on a central server, we have a copy on each developer’s computer.
Working with Git
Source: Working with Git

Git, like any other software, must first be downloaded and installed in order to be used. You can even run the git --version command to see what your current version of Git is.

The first step to using a repository is to either clone one if you have access to it or to initialize one.

git clone <repo_path> and git init

These commands will create a new folder named .git, which will contain all the information about your repository that Git tracks: commits, branches, history, and so on.

The workflow of contributing to a Git repository is the following:

1. Stage the files

The first step is to add the files you want to add to a repository in the staging area. The purpose of this staging area is to keep track of all the files that are to be committed.

You can stage files using the git add <file_name> command or git add . to stage all the files.

File status lifecycle
Source: What are the differences between git file states

2. Commit the changes

The second step is to commit the changes. In this step, all the files that were added to the staged zone will be added to the local repository. The command for this is git commit -m "<your_message_here>". The message should be something relevant about the changes you have added.

3. Push the code

The last step is to push your changes from your local repository to the remote repository with the help of the git push command.

What are some common Git errors?

Fatal: not a git repository (or any of the parent directories): .git is just one of many other errors that can occur when working with Git. Here is a list of other common errors that may occur along with a brief explanation.

1. Permission denied

Permission denied when accessing 'url-path' as user 'username'

Git repositories can be of two types: public or private. In a public Git repository, everyone can view the code and clone it on their local machines. For the private ones, you need to be authenticated on the platform that the repository is hosted on in order to clone it onto your computer. At the same time, you need to have explicit rights to it.

The error stated above indicates that you possess an authenticated useraddname-password pair, but you do not maintain the files in the repository you are accessing. Thus, your assigned role in the repository must be increased to at least that of a maintainer or some similar position that the distribution platform provides, like maintainer, developer, admin, and so on.

2. Failed to Push Some Refs

git push rejected: error: failed to push some refs

What are the differences between git file states

Source: What are the differences between git file states

The purpose of Git is to collaborate and share work within a project while all the participants contribute to the same code base. One common scenario is when someone else pushes some code to the same branch you are working on, and you are trying to make your changes as well. The above error indicates that there is one more commit that was pushed to the same branch, but you don’t have that commit on your local machine.

To fix this, you can easily run a git pull origin <your-branch>, solve the conflicts if any, and then run git push origin <your-branch> to push your changes as well.

3. fatal: A branch named <branch-name> already exists

Most VCS (version control systems) have some form of support for branching mechanisms, including Git. Branches can be created directly in the remote repository, or they can be created locally and then pushed to the remote repository.

To create a new branch locally, you can run either:

git branch <new-branch or git branch <new-branch> <base-branch>

The first one, git branch <new-branch>, is used to create a new branch based on the currently checked out (HEAD) branch, meaning that if you are on a branch master and run git branch dev, it will create a new branch named dev from the branch master.

The second one is used when you want to create a new branch from a different branch, then the one that you are currently checked out. git branch qa master will create a new branch named ‘qa‘ from the master branch.

The branch names must be unique, therefore the error above, fatal: A branch named <branch-name> already exists., states that you already have a branch in your local repository with the same name.

4. Can’t switch between branches

Imagine this scenario: you have two branches, master and dev, both with committed files to the repository. On your local system, you do some changes in a file from the dev branch. At this point, if you want to move back to master and you run the command git checkout master, you will receive the following error:

error: Your local changes to the following files would be overwritten by checkout

This error means that you have some files that have been edited but not committed, and by checking out another branch, you’ll overwrite and lose these edits. The solution is to either commit these changes or if you don’t want to commit them yet, to stash them.

What causes Git errors?

Git errors are like any other CLI software errors. Most of the time, they represent a misuse of the command, wrong command names, missing parameters, wrong scope, etc.

There may also be cases where the error is not a user error but a software error. In those situations, either the application encountered a bug or the integrity of the application is corrupted. This can usually originate from missing data or the unintentional deletion of the required files.

In the former case, you can report the bug, and once it is fixed, the Git application can be updated. For the latter, the easiest solution is to remove the software and install it again.

Conclusion

Git is one of those applications you can use without ever thoroughly learning it because most of the time, the way you use it is straightforward as you limit yourself to the same commands over and over again. But if you never take the time to understand how it works and the philosophy behind it entirely, the confusion will never go away, and you can reach a stalemate if you have to do a few more complex operations. In this article, we covered the "fatal:not a git repository" error and everything to do with it, and then explored a few more Git errors.

Git these days is the most popularly used tool to manage your projects remotely while availing the benefits of version controlling. Sometimes while working with a particular git repository your operations just do not succeed and you face the fatal: not a git repository (or any of the parent directories):.git. 

The error can be simply dealt if you follow the right steps to work with Git. In this article, we will go through the solutions that can help you in solving this “not a git repository” error.

What Causes the fatal: not a git repository Error?

Following are the possible reasons that can cause the error to be raised:

1. You tried to run the Git commands outside of a Git directory/ non-Git folder.

2. The repository in which you re trying to run the command has not been initialized in your project directory.

Solutions to Resolve fatal: not a git repository Error.

Solution#01: Initialize the Git Repository in your Project Folder.

If you are in your project folder, first check if this directory is initialized with git. Use the command ls -la to check this. If you are in git initialized folder you will see the .git/ folder in the output of the project.

If your project folder is not initialized as a git repository, you will not see the .git/ folder in it, like the output given below:

fatal: not a git repository

If this is the case, then first initialize the folder by using git init command in the project directory.

fatal: not a git repository

After running the git init command, you will now see .git/ folder in the project directory. Let’s check.

fatal: not a git repository

Solution#02: View and Open the Right Directory to Perform Git Operations.

To run Git commands successfully you need to be in the right project directory. Following are the steps to navigate to the right directory, make sure you follow them:

1. Open the Command Prompt and go to the right folder where you want to clone the repository, using the cd command.

fatal: not a git repository

2. Go to your existing Github repository that you want to connect with local project.

3. Copy the link to clone the repository.

fatal: not a git repository

4. Take this copied link and clone the repo with the git clone url. The output will somehow be like the following.

fatal: not a git repository

Now you are in the correct folder where your remote repository is cloned, and the git commands should be operational here if it is initialized correctly.

Conclusion

In this article we discussed about the possible causes that can give a rise to the fatal: not a git repository error. Later, we observed the possible solutions to deal with the error. It is indeed possible that if you are following the Git workflow properly you will not get a hit with such errors, but otherwise you can follow this guide to resolve the issue if it occurs.

An error that begins with “fatal” never sounds good. Do not worry; the cause of the fatal: not a git repository (or any of the parent directories): .git error is simple. This error is raised when you try to run a Git command outside of a Git repository.

In this guide, we talk about this error and why it is raised. We walk through two potential solutions so you can learn how to overcome a “not a git repository” error when working with Git. Without further ado, let’s begin!

Get offers and scholarships from top coding schools illustration

Find Your Bootcamp Match

  • Career Karma matches you with top tech bootcamps
  • Access exclusive scholarships and prep courses

Select your interest

First name

Last name

Email

Phone number

By continuing you agree to our Terms of Service and Privacy Policy, and you consent to receive offers and opportunities from Career Karma by telephone, text message, and email.

fatal: not a git repository (or any of the parent directories): .git

The cause of this error message is running a Git command outside of a directory in which a Git folder is initialized. For instance, if you try to run “git commit” in a non-Git folder, you see an error. Git cannot run unless you view a folder configured with Git.

This is because Git is configured in a specific directory. Every Git project has a secret folder called .git/. You can view this folder by running the following command:

.git/ contains all of the configuration files for a repository. Without this folder, Git does not know anything about a project. This folder contains information such as the Git remotes associated with a repository, Git environment variables, and your current HEAD.

Run git commit inside a folder that is not a Git repo:

This command returns:

fatal: not a git repository (or any of the parent directories): .git

Let’s solve this error.

Two Possible Causes

There are two possible causes for the “not a git repository” error.

Viewing the Wrong Directory

Check whether you view the correct directory. For instance, if you are in your home folder, you are not in a Git folder. If you are in a project folder, ensure it is the one where initialized a Git folder.

No Git Repository Has Been Initialized

If you are in a project folder and you see a “not a git repository” error, check whether a repository is initialized. You can do this by running ls -la and checking for a .git/ folder.

If no .git/ folder is present, you have not initialized a repository. This means there is no record of Git inside a particular project folder.

To solve this error, run git init in your project folder:

The git init command initializes a new Git repository in your current working directory.

Conclusion

The “not a git repository” error is common. The cause is running a Git command in the wrong folder or running a Git command before initializing a Git repository. 

Now you’re ready to solve the “not a git repository” error like an expert developer!

Image of fatal: not a git repository (or any of the parent directories): .git

Table of Contents

  • Introduction
  • Why Am I Seeing This Error?
  • Setting Up A New Repository
  • Cloning An Existing Repository
  • Locating An Existing Repository
  • Have Sources But No .git Folder
  • Something Is Wrong Within An Existing .git Directory
  • Summary
  • Next Steps

Introduction

Working with Git can be a joy, until it isn’t. Suppose you’re working on your project at a nice pace, you’ve created a branch, doing regular commits and a dozen other things. Then you’re not exactly sure what you did last, but Git isn’t liking it. Suddenly, you’re faced with the nondescript error message:

fatal: not a git repository (or any of the parent directories): .git

In this article, we’ll discuss the reasons for the error fatal: not a git repository (or any of the parent directories): .git and how to fix it.

Why Am I Seeing This Error?

The fact that the error received is a «Git error» means that Git is installed on the local system, and that the executable is accessible on the local path. This typically rules out an installation issue as being the problem.

What the error is telling you is that you issued a Git command, (usually within a command line shell), inside a directory that isn’t part of a Git repository, or isn’t recognized as one. Essentially, the directory you ran the Git command in is not tracked by Git, so Git can’t perform the requested action such as git status, git add, git commit, etc.

Git determines whether you’re in a Git repository by looking for a specific hidden folder in the current directory, or one of its parents. This folder is aptly named, .git. If present, this folder should be in the root of your project tree. If Git can’t locate this folder from the directory you issued the Git command in, it will throw the above error.

There are a few scenarios that commonly lead to this issue:

  1. Most likely: You need a little help setting up a new local repository, or cloning an existing one.
  2. Somewhat likely: You need help locating an existing Git repository on your local machine.
  3. Pretty unlikely: You deleted your entire Git repository or just the .git folder at the root of your project.
  4. Unlikely: Somehow the state of your local repository got corrupted.

Let’s discuss each of these in turn.

Setting Up A New Repository

Before you can successfully run most of Git’s commands, you need to create and navigate into a Git repository.

You may have a project folder already created, perhaps with sources already present, or you may be starting fresh and need to create a brand new project folder.

In either case, open your preferred command shell (cmd on Windows, bash on unix-like systems, or Terminal on your Mac) and follow these steps:

  • If you’re starting fresh, create a new folder for your project.
  • Then cd into your newly created, or already present, project folder — you want to be at the root of your project’s folder tree.
  • From within this folder enter the command: git init

That’s it. very simple. You should see some output like the following:

$ mkdir my-project  # If creating a new folder.
$ cd my-project
$ git init

Initialized empty Git repository in /home/me/projects/my-project/.git/

If you have existing sources you can add them to the repository using the git add and git commit commands. git add «stages» (or prepares) any changes you’ve made to files in your repository for a check in. To check in, or in version control vernacular, to commit these changes, you issue the git commit command along with a brief commit message describing what modifications are being committed.

The commands with the output should look something like the following:

$ git add .
$ git commit -m "Initial commit"

[master (root-commit) 0879183] initial commit
 21 files changed, 4630 insertions(+)
 create mode 100644 LICENSE-MIT
 create mode 100644 README.md
           :
           :

Each time you make a commit, the repository keeps information on the state of your files — a sort of snapshot. And it’s good practice to do a commit on any significant change to any of your files. A clean commit history can be very useful to you as you learn more about Git’s version control capabilities.

Cloning An Existing Repository

If you are not starting a new project, but instead joining an existing project, you will need to clone (download and copy) that repository to your local machine.

Cloning an existing repository is a very simple operation using the git clone command. You should have a URL to the remote repository; or if cloning locally, you should have a file system path to the repository folder or share. For instance, let’s say we want to grab a project from GitHub.

GitHub has training projects that users can access to safely experiment with. So let’s use one such training project called Spoon-Knife whose URL is https://github.com/octocat/Spoon-Knife. All we need to do to download/copy the files for the project is issue the git clone command like so:

$ git clone https://github.com/octocat/Spoon-Knife

Cloning into 'Spoon-Knife'...
remote: Enumerating objects: 16, done.
remote: Total 16 (delta 0), reused 0 (delta 0), pack-reused 16
Unpacking objects: 100% (16/16), 2.24 KiB | 458.00 KiB/s, done.

After navigating into the Spoon-Knife folder, you can now issue the git status command (or any other Git command), and the error message you saw earlier shouldn’t occur for this local repository. You should see something like the following:

$ git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

That’s all there is to retrieving the sources and creating a local repository. Very simple.

Locating An Existing Repository

If you know that you previously had a local project folder that was successfully being tracked using Git, you may just need to manually (visually) verify whether the current directory holds the hidden .git folder, you can issue the following commands.

Unix-like systems:

$ ls -a

Windows:

C:...> dir /d

Each command with the additional parameter lists the hidden folders in addition to the visible folders. You can issue cd .. to navigate back through each of the parent folders in turn, also checking them for the hidden .git folder.

If you are on Unix/Linux and still have no clue where the hidden .git folder might be, you can use the Linux find command to track it down by doing a system-wide search.

Unix-like systems:

$ find / -type d -name ".git"

./projects/emoji_chat/.git
./projects/python_projects/web_scraper/.git
./projects/python_projects/experiments/.git

The / specifies the path of the folder find will start from as it recursively descends into child folders looking for any .git directories. The above will start the search from your system’s root directory. You can replace this with whatever path you feel is appropriate.

The -type d option will specifically search for directories, and the -name ".git" option will only list those named .git.

On Windows, you can use the file explorer to search, but make sure it’s configured to show hidden folders.

Have Sources But No .git Folder

This section covers the case where you have the sources to a project that has a Git repository, but for whatever reason don’t have the .git folder. This isn’t an uncommon problem. Maybe you downloaded the sources for a project in a compressed archive that didn’t include the version control files, or you did have the .git folder at one point but for whatever reason deleted it.

If you haven’t made modifications to the sources, you can opt to clone a fresh local copy of the project.

If you’ve modified the sources and want to add your changes to the repository, a simple strategy is to clone the project into a new project folder, then copy the files you modified over their counterparts in the new tree.

It’s a good idea to compare your version of the affected files with their counterparts. Otherwise you could be overwriting recent changes made by other developers. If you skip that step and commit your overwritten files, Git will assume any differences between these files and and the version of them last checked in are changes you intentionally made — it doesn’t know the difference.

One approach is to do a side-by-side comparison in your editor of choice if the changes are minor, and cut/paste the changes in. Or you can use the diff features of your IDE or other tools you’re familiar with, such as the git diff command.

Another option, and probably the best in most cases, is to create a new branch in the project repository, copy your files over the new branch’s files, then merge the new branch with the master branch (or whichever branch you plan on updating). The examples below will assume you chose the master branch to merge to.

For any given Git repository, there is one main branch, the name of it can vary, but for the majority of projects it’s named master, but is also sometimes named main. You can use the git branch command from within your project directory to get a listing of your branch names.

To create and switch to a new branch, issue the following commands in the shell:

$ git status
On branch master
      :
$ git checkout -b my-changes
Switched to a new branch 'my-changes'

The output of the last command indicates we successfully created a new branch called my-changes and switched to the new branch in our working directory. Now copy your modified files over the files in the repository. Copying over the files is safe, changes we make to this new branch won’t affect the master branch for now. After copying over the files, issue the following commands to commit the changes and switch back to the master branch.

$ git commit -a -m "Copied over files."

[temp 64295f3] Copied over files.
 1 file changed, 6 insertions(+)

$ git checkout master

Switched to branch 'master'
Your branch is up to date with 'origin/master'.

The first command above committed the files we overwrote, and the second command switched the repository back to the master branch. If you were to look at the files again, you’d see that they reverted to their original state from before we copied over them. If you were to switch back to the my-changes branch, you’d see the copied over versions.

Now we’ll interactively merge the changes from my-changes into master. Issue the following command to begin the process.

git checkout -p my-changes --

The interactive merge utility will display the changes to be approved in small blocks with the code being replaced above the code replacing it. You can have the utility break its currently displayed block into smaller pieces for approval with the «s» option — if displayed.

$ git checkout -p my-changes --

diff --git b/index.html a/index.html
index a83618b..cf2b938 100644
--- b/index.html
+++ a/index.html
@@ -16,5 +16,11 @
    :
-<img src="my-dog.jpg" id="pet-pic" alt="" />
    :
+<img src="my-cat.jpg" id="pet-pic" alt="" />
    :

(1/1) Apply this hunk to index and worktree [y,n,q,a,d,e,?]?

In the output above, lines that are to be removed are preceded by a «-«, and lines to be added added preceded by a «+». To get a listing of what the options mean, enter «?» at the prompt.

Some of the useful options are:

  • ? — help on the available options.
  • n — reject the currently displayed block’s changes.
  • y — accept the current block.
  • s — break the current block into smaller pieces.
  • e — edit the current block in the terminal’s graphical editor.

Once you’re done with your interactive session, you’ll have merged your changes in while preserving any changes submitted by others. The sources are now ready to be checked in to the repository.

The merge utility doesn’t automatically commit the changes. It only modifies the work files, which should be ready for commit after you’ve run it and carefully selected the changes to include.

The above process assumes you want to merge changes into the master branch, but you could just as well have merged into another branch you created, or checked out.

Something Is Wrong Within An Existing .git Directory

This is an uncommon problem, but fixable. The good news is you almost certainly won’t have to go into the .git folder and hack things manually.

It’s a wise decision to make a copy of the project tree before doing anything else, so if something goes wrong you won’t lose the current state of your source files.

Generally, to verify something went awry in a .git repository, you can issue the git fsck command to get a report on what the problem may be. However, if you were getting this article’s error message, that’s all you’re likely to see in this specific case.

$ git fsck

fatal: not a git repository (or any of the parent directories): .git

If you run it, you’ll likely see the error message that brought you here in the first place. Checking the .git folder you should see the following.

$ ls .git

branches        config       FETCH_HEAD  hooks  info  objects    refs
COMMIT_EDITMSG  description  HEAD        index  logs  ORIG_HEAD

When a repository is broken, it can be hard to detect an obvious cause of the problem unless you have some in-depth experience with Git and the files it maintains, but it doesn’t hurt to give a quick visual inspection of the .git folder in case there’s an obvious cause, such missing files.

Anyway, you have a confirmed problem that needs fixing. There’s an application that may be able to fix the repository automatically for you called git-repair. This is a fairly comprehensive tool that fixes a wide range of issues.

First, confirm whether the tool is already installed or not by trying to invoke it with the help flag: git-repair --help. If it’s there you should see the help text displayed and you can skip the installation steps.

Information on the tool can be found on the git-repair home page, or the Haskell package repository for git-repair.

If you’re using Linux, this tool may be available via a package manager like apt. You can try the following command to see if that’s the case.

sudo apt-get update
sudo apt-get install git-repair

If it’s not available that way, you can follow the simple instructions on the tool’s home page to install the Haskell platform and build the tool for your system.

Once you have the tool installed, you can give it a run.

$ git-repair
Running git fsck ...
No problems found.

In the example above, the tool ran and then reported there were no problems. That doesn’t mean it didn’t do anything. Now if you run git fsck again you should see some encouraging information displayed instead of the fatal: not a git repository... message. It should look something like the following.

$ git fsck

Checking object directories: 100% (256/256), done.
notice: HEAD points to an unborn branch (master)

In the above example, it looks like the tool has done a somewhat good job at recovering what may have felt to be a dire situation at first. The notice message above is indicating that HEAD is pointing to the wrong place. HEAD is simply a file with the one line of text indicating which branch we’re currently working on. Minor problems like this aren’t difficult to fix.

Continuing with the above example, let’s try switching to the ‘master’ branch.

$ git switch master

error: The following untracked working tree files would be overwritten by checkout:
	README.md
	index.html
	styles.css
Please move or remove them before you switch branches.
Aborting

So the error message is telling us to move or remove the listed files to ensure we don’t lose any work. So let’s remove these files and then switch back to the branch we were working on, which was ‘master’ in the example.

$ rm README.md 
$ rm index.html 
$ rm styles.css 

$ git switch master

Switched to branch 'master'
Your branch is up to date with 'origin/master'.

$ ls

backup  git-repair  index.html  README.md  styles.css

Now the repository is recovered, and in this particular case we can copy the files back over. This should be fine because the files were restored from the local repository and should be current minus some changes that hadn’t been checked in yet.

Summary

In this article, we discussed several reasons for the error fatal: not a git repository (or any of the parent directories): .git and how to fix them.

We’ve covered quite a few scenarios, and if you’ve read along you should have some new tools in your tool case. Git is a great version control tool, and it can be very useful, not only for work or project contributions, but also for any personal projects you have on your system that you want to maintain a change history for that you can refer to, create experimental branches while preserving the work in others, revert to previous versions of files, etc.

Next Steps

I find it’s very useful to have a cheat sheet for command line applications like Git. We’ve written several cheat sheets to help users with different levels of coding experience. The simplest is the beginner Git cheat sheet, followed by the intermediate Git cheat sheet, and lastly the expert Git cheat sheet.

If you’re interested in learning more about how Git works under the hood, check out our Baby Git Guidebook for Developers, which dives into Git’s code in an accessible way. We wrote it for curious developers to learn how Git works at the code level. To do this we documented the first version of Git’s code and discuss it in detail.

Thanks and happy coding! We hope you enjoyed this article. If you have any questions or comments, feel free to reach out to jacob@initialcommit.io.

Final Notes

In this post, we provide 4 fixes for a common error when you’re trying to create a Git repository.

If you’re using the Git program, there could be some instances where you’ll come across a number of errors, especially when creating a Git repository. One of these errors come in the form of this message:

fatal: not a git repository (or any of the parent directories): .git

If you’re fairly new to Git, then this might sound overwhelming for you. Fortunately, there are a few quick fixes you can follow to resolve this problem. We’ll try to tackle as many of them as possible to provide you with a working fix so you can get rid of such error.

The “fatal: not a git repository (or any of the parent directories): .git” error is a type of error which can come up each time you create a Git depository or try to add an existing repository to github.com. Some users reported encountering this error when entering a command and the website prompted them to put into the terminal.

There can also be instances where they’ll encounter the error when remote adding a Git repository into their local machine. In fact, there can be various causes for this error. That said, there are a few quick fixes for this.

How to Fix the “fatal: not a git repository (or any of the parent directories): .git” Error?

Resolving this specific git error can be a bit technical, but as long as you follow the steps, you’ll have a higher chance of fixing it.

1st Fix: Execute Git Init

The first fix we’re going to try is one which is provided by the Knowledge Base at Cloud Ingenium. This applies if you’re using a third-party website such as BitBucket for adding private Git repositories for free (considering that GitHub has some fees for doing so).

According to them, in order to add your repository to BitBucket, you’ll have to follow this instruction:

cd /path/to/my/repo

git remote add origin https://[email protected]/UserName/Project-Name.git

git push -u origin –all # pushes up the repo and its refs for the first time

git push -u origin –tags # pushes up any tags

Unfortunately, this resulted in the “fatal: not a git repository (or any of the parent directories): .git” error. Fortunately, this problem can be easily fixed. Here’s how:

  1. Start your local repository with a Git repository which is empty.
  2. After that, execute git init.
  3. Afterward, you’ll then receive this message: Initialized empty Git repository in /etc/somefolder/.git/
  4. Once you’re done, proceed to run a remote add origin command.

Video Guide: Copying a GitHub Repository to Your Local Computer

2nd Fix: Initialize Your Repository

This second fix is designed when you encounter the error message when pushing a repository to GitHub.com. Since the error will appear upon entering a command and the website prompts you to put the repository to the terminal, fixing the issue can be as simple as determining if you are in the right directory or not.

A user which goes by the name of jozefg at Stack Overflow recommends the following:

  1. Check if you’re in the right directory. You can do this by typing “ls” and checking whether it’s showing the right files or not.
  2. Initialize your repository. If you haven’t done it yet, simply type “git init”.

Hopefully, either one of the two can solve the fatal error message you’re encountering. If not, then proceed to the next fixes.

Video Guide: Git Tutorial For Creating Your First Repository

3rd Fix: Check the Directory or Initialize a Repository

This fix is made for individuals who are experiencing the same error when using the Heroku client package for Ruby on Rails programming. The error tends to happen when you open a new terminal and then enter this line:

git push heroku master

The issue, which was posted on Stack Overflow, comes with a few different fixes which can hopefully get rid of the error. Two of them, which are provided by users pjammer and Fiona T, involves the following:

  1. Making sure you’re on a git repository directory. To do this, simply type “pwd” then check if you’re in the right directory. It could be that you’re in the ~/ or another directory.
  2. Creating a git repository. To do so, simply use “git init” similar to that of the other fixes.

Video Guide: SignalR Tutorial 21 – Setting up a Git Repository

4th Fix: Setup Your Repository Properly

The 4th fix is from the same forum but is provided by another use by the name of Prakash Murthy. According to him, the error message could possibly be due to an improper git init setup. He recommends making sure that you’ve followed all the instructions with regards to the installation and setup of Git in your system. Here’s how:

  1. If it’s your first-time setup, you’ll have to do some one-time setups first. These include entering the following lines: $ git config –global user.name “Your Name” and $ git config –global user.email [email protected]. Keep in mind that the name and email address which you use will also be available in any public repositories you make.
  2. After that, the next step is to set up your repository. What you should do is to navigate to the root directory of your first app then execute the following lines:

$ git init

Initialized empty Git repository in

/home/ec2-user/environment/environment/hello_app/.git/

  1. Once you’re done, add your files to your repository using this line: $ git add –A. This line will add all files in your current directory except for those that have matched the patterns in the .gitignore file. This file will automatically be created with the Rails new command with regards to a Rails Project. However, you also have the option to add new patterns.
  2. Your files when then be stored in a staging area waiting for a confirmation. To check your files, you can use the $ git status command. If you want to commit the changes, simply use the “commit” command.

Hopefully, by properly setting up Git in your system, you’ll be able to get rid of the problem for good.

Forum Feedback

To understand more about the problem computer screen sideways, we read through different support boards. People were interested in knowing about how to fix a computer screen sideways, and computer screen sideways fix on Windows 10 and Windows 7. Some were also looking for answers on computer screen sideways Chromebook, HP, and Lenovo.

  • A computer user complained that his screen got turned sideways while he was working on it.
  • The person wasn’t computer savvy and was wondering how to fix the problem. He attempted to do it from Properties but didn’t have much success.
  • Finally, he asked for help online, and another computer expert explained that he must have press some keys accidentally to change the position of the screen.
  • To solve the problem, the person said that he had to press Ctrl + Alt + UP Arrow Key and that it should fix his screen.
  • However, he warned that the solution might not work for Windows 10.

Another person also mentioned that he had a similar problem with his old Windows XP computer and that he looked for a solution online. People suggested that he tried the Ctrl + Alt + an arrow key until he found the correct screen position.

A computer expert explains that if you can’t turn your screen using Ctrl + Alt + Arrow Key, you can try the graphics option because the rotation of the screen is a feature of your graphics card.

  • The user states that you if you use Windows 10, you should click on the empty desktop, choose Display Settings and select the right orientation from the Orientation drop-down menu.
  • If you’re still using Windows 7 and Windows 8, you should choose Control Panel > Appearance and Personalization > Adjust screen resolution > Orientation.
  • Another individual commented that if you couldn’t fix your sideway computer screen, you might try to restore the system to a previous point.
  • However, he pointed out that it’s a last resort measure and the problem would rarely be so serious as to require a system restore.

A person observes that your screen might have turned sideways because you have a problem with your graphics card if you’re certain that you haven’t pressed anything.

  • In such cases, he recommends that you update your graphics cards drivers.
  • The update will take care of any missing or corrupted files and should resolve your screen troubles.
    Another person pointed out that you can restore your screen by clicking on the desktop and choosing Graphics Options.
  • He also mentioned that if the Ctrl + Alt + UP command is not working your hotkeys might have been disabled.

A forum member complained that since he installed Windows 10, his screen started to turn sideways from time to time. He was able to fix it with the Ctrl + Alt + Arrow Key, however, it kept happening every time he would open a new application.

  • The user went looking for a solution online, but he was unable to find one.
  • The only thing that support suggested was to run the commands for corrupted files, which didn’t yield any result.
  • He concluded that if the problem persisted, he would opt to uninstall Windows 10 and go back to Windows 8.1.

Another Windows 10 user also shared that he had to change the orientation of his screen several times after a major Windows update. The person was certain that he had saved his preferences to landscape orientation, but his device kept turning it back to portrait. Finally, he noticed in the settings that his device was set to tablet. After he turned it off, the problem disappeared.

Another person mentioned that he was experiencing the same Windows 10 problem and that the Ctrl + Alt + Arrow Key command wasn’t working for him. So, he reached out to support, and they suggested that he should roll back or uninstall the drivers of the display device. Support also said that he could try to update his graphics drivers from the official page of the manufacturer.

A user said that the screen on his Chromebook suddenly turned sideways. He was cleaning the keyboard, so he supposed that he had pressed the wrong buttons. Other forum members explained that he could rotate the screen by pressing Cntl+Shift+circular arrow, which would rotate the screen 90 degrees. The added that he should continue to press the buttons until the screen was back in its original position.

Conclusion

The “fatal: not a git repository (or any of the parent directories): .git” error is quite a technical error requiring a bit of technical and programming knowledge. However, if you already know how to work your way around Git, you should be able to resolve this issue using the above fixes.

Ryan is a computer enthusiast who has a knack for fixing difficult and technical software problems. Whether you’re having issues with Windows, Safari, Chrome or even an HP printer, Ryan helps out by figuring out easy solutions to common error codes.

Description

I interrupted a commit by deleting the project files and adding the new ones and it throws the error fatal: not a git repository (or any of the parent directories): .git

Version

  • GitHub Desktop:1.26
  • Operating system:Microsoft Windows [Version 10.0.15063]

Steps to Reproduce

  1. Commit to master

  2. Delete the file while it is uploading

  3. Replace the files

  4. Commit to master throws fatal: not a git repository (or any of the parent directories): .git

5 Desktop git keeps throwing fatal: not a git repository (or any of the parent directories): .git over and over

Expected Behavior

To upload my updates project

Actual Behavior

fatal: not a git repository (or any of the parent directories): .git

Additional Information

Logs

2018-07-18T04:31:01.316Z — info: [main] Received possible protocol arguments: 2
2018-07-18T04:31:02.396Z — info: [ui] [AppStore] loading 0 repositories from store
2018-07-18T04:31:02.419Z — info: [ui] [Welcome] no sign in step found. ignoring…
2018-07-18T04:31:02.421Z — info: [ui] [Welcome] no sign in step found. ignoring…
2018-07-18T04:31:02.423Z — info: [ui] [Welcome] no sign in step found. ignoring…
2018-07-18T04:31:02.495Z — info: [ui] [Welcome] no sign in step found. ignoring…
2018-07-18T04:31:02.653Z — info: [ui] launching: 1.2.6 (Windows 10.0.15063)
2018-07-18T04:31:02.653Z — info: [ui] execPath: ‘C:UsersaljohAppDataLocalGitHubDesktopapp-1.2.6GitHubDesktop.exe’
2018-07-18T04:31:02.657Z — info: [ui] [Welcome] no sign in step found. ignoring…
2018-07-18T04:31:02.698Z — info: [ui] [Welcome] no sign in step found. ignoring…
2018-07-18T04:54:09.119Z — info: [ui] [Welcome] advancing to step: SignInToDotCom
2018-07-18T04:54:09.124Z — info: [ui] [Welcome] current sign in state not found. ignoring…
2018-07-18T04:54:24.144Z — info: [ui] [Welcome] kind Authentication is the same as Authentication. ignoring…
2018-07-18T04:54:26.374Z — info: [ui] [AppStore] adding account ninjapanda1125 (ninjapanda1125) to store
2018-07-18T04:54:26.376Z — info: [ui] [Welcome] advancing to step: ConfigureGit
2018-07-18T04:54:26.460Z — info: [ui] [Welcome] no sign in step found. ignoring…
2018-07-18T04:55:00.403Z — info: [ui] [Welcome] advancing to step: UsageOptOut
2018-07-18T04:55:03.832Z — info: [ui] Opt out reported.
2018-07-18T05:53:02.331Z — info: [ui] [AppStore] adding repository at C:UsersaljohDocumentsGitHubPokemon-Pollution to store
2018-07-18T05:57:06.701Z — error: [ui] git checkout HEAD -- exited with an unexpected code: 128.
fatal: Unable to create ‘C:/Users/aljoh/Documents/GitHub/Pokemon-Pollution/.git/index.lock’: File exists.

Another git process seems to be running in this repository, e.g.
an editor opened by ‘git commit’. Please make sure all processes
are terminated then try again. If it still fails, a git process
may have crashed in this repository earlier:
remove the file manually to continue.

(The error was parsed as 34: A lock file already exists in the repository, which blocks this operation from completing.)
2018-07-18T05:59:41.540Z — info: [ui] Executing updateIndex: git update-index —add —remove —replace -z —stdin (took 161.829s)
2018-07-18T05:59:57.139Z — info: [ui] Executing createCommit: git commit -F — (took 15.599s)
2018-07-18T05:59:58.842Z — info: [ui] Executing getStatus: git status —untracked-files=all —branch —porcelain=2 -z (took 1.702s)
2018-07-18T05:59:58.880Z — info: [ui] Executing getBranches: git for-each-ref —format=%(refname)%00%(refname:short)%00%(upstream:short)%00%(objectname)%00%(author)%00%(committer)%00%(parent)%00%(symref)%00%(subject)%00%(body)%00%(trailers:unfold,only)%00%1F refs/heads refs/remotes (took 1.709s)
2018-07-18T05:59:58.914Z — info: [ui] Executing getRecentBranches: git log -g —no-abbrev-commit —pretty=oneline HEAD -n 2500 — (took 1.714s)
2018-07-18T06:13:27.282Z — error: [ui] git status --untracked-files=all --branch --porcelain=2 -z exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:13:27.333Z — error: [ui] git for-each-ref --format=%(refname)%00%(refname:short)%00%(upstream:short)%00%(objectname)%00%(author)%00%(committer)%00%(parent)%00%(symref)%00%(subject)%00%(body)%00%(trailers:unfold,only)%00%1F refs/heads refs/remotes exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:13:27.514Z — error: [ui] git remote -v exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:13:44.768Z — error: [ui] git reset -- . exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:14:09.077Z — info: [ui] [AppStore] loading 1 repositories from store
2018-07-18T06:14:09.078Z — info: [ui] [AppStore] found account: ninjapanda1125 (ninjapanda1125)
2018-07-18T06:14:09.398Z — error: [ui] git for-each-ref --format=%(refname)%00%(refname:short)%00%(upstream:short)%00%(objectname)%00%(author)%00%(committer)%00%(parent)%00%(symref)%00%(subject)%00%(body)%00%(trailers:unfold,only)%00%1F refs/heads refs/remotes exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:14:09.425Z — error: [ui] git status --untracked-files=all --branch --porcelain=2 -z exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:14:09.520Z — error: [ui] git remote -v exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:14:09.692Z — error: [ui] git remote -v exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:14:09.695Z — error: [ui] git status --untracked-files=all --branch --porcelain=2 -z exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:14:09.833Z — info: [ui] launching: 1.2.6 (Windows 10.0.15063)
2018-07-18T06:14:09.834Z — info: [ui] execPath: ‘C:UsersaljohAppDataLocalGitHubDesktopapp-1.2.6GitHubDesktop.exe’
2018-07-18T06:14:09.838Z — error: [ui] git for-each-ref --format=%(refname)%00%(refname:short)%00%(upstream:short)%00%(objectname)%00%(author)%00%(committer)%00%(parent)%00%(symref)%00%(subject)%00%(body)%00%(trailers:unfold,only)%00%1F refs/heads refs/remotes exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:14:10.000Z — error: [ui] git remote -v exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:14:24.940Z — error: [ui] git status --untracked-files=all --branch --porcelain=2 -z exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:14:24.982Z — error: [ui] git for-each-ref --format=%(refname)%00%(refname:short)%00%(upstream:short)%00%(objectname)%00%(author)%00%(committer)%00%(parent)%00%(symref)%00%(subject)%00%(body)%00%(trailers:unfold,only)%00%1F refs/heads refs/remotes exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:14:25.048Z — error: [ui] git remote -v exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:14:25.102Z — error: [ui] git remote -v exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:19:28.996Z — error: [ui] git status --untracked-files=all --branch --porcelain=2 -z exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:19:29.052Z — error: [ui] git for-each-ref --format=%(refname)%00%(refname:short)%00%(upstream:short)%00%(objectname)%00%(author)%00%(committer)%00%(parent)%00%(symref)%00%(subject)%00%(body)%00%(trailers:unfold,only)%00%1F refs/heads refs/remotes exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:19:29.170Z — error: [ui] git remote -v exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:19:38.732Z — error: [ui] git status --untracked-files=all --branch --porcelain=2 -z exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:19:38.777Z — error: [ui] git for-each-ref --format=%(refname)%00%(refname:short)%00%(upstream:short)%00%(objectname)%00%(author)%00%(committer)%00%(parent)%00%(symref)%00%(subject)%00%(body)%00%(trailers:unfold,only)%00%1F refs/heads refs/remotes exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:19:38.851Z — error: [ui] git remote -v exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:19:38.903Z — error: [ui] git remote -v exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:19:48.220Z — info: [ui] [AppStore] loading 1 repositories from store
2018-07-18T06:19:48.221Z — info: [ui] [AppStore] found account: ninjapanda1125 (ninjapanda1125)
2018-07-18T06:19:48.550Z — error: [ui] git for-each-ref --format=%(refname)%00%(refname:short)%00%(upstream:short)%00%(objectname)%00%(author)%00%(committer)%00%(parent)%00%(symref)%00%(subject)%00%(body)%00%(trailers:unfold,only)%00%1F refs/heads refs/remotes exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:19:48.570Z — error: [ui] git status --untracked-files=all --branch --porcelain=2 -z exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:19:48.661Z — error: [ui] git remote -v exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:19:48.835Z — error: [ui] git remote -v exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:19:48.846Z — error: [ui] git status --untracked-files=all --branch --porcelain=2 -z exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:19:48.987Z — info: [ui] launching: 1.2.6 (Windows 10.0.15063)
2018-07-18T06:19:48.987Z — info: [ui] execPath: ‘C:UsersaljohAppDataLocalGitHubDesktopapp-1.2.6GitHubDesktop.exe’
2018-07-18T06:19:48.990Z — error: [ui] git for-each-ref --format=%(refname)%00%(refname:short)%00%(upstream:short)%00%(objectname)%00%(author)%00%(committer)%00%(parent)%00%(symref)%00%(subject)%00%(body)%00%(trailers:unfold,only)%00%1F refs/heads refs/remotes exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:19:49.126Z — error: [ui] git remote -v exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:21:04.658Z — error: [ui] git status --untracked-files=all --branch --porcelain=2 -z exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:21:04.706Z — error: [ui] git for-each-ref --format=%(refname)%00%(refname:short)%00%(upstream:short)%00%(objectname)%00%(author)%00%(committer)%00%(parent)%00%(symref)%00%(subject)%00%(body)%00%(trailers:unfold,only)%00%1F refs/heads refs/remotes exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:21:04.819Z — error: [ui] git remote -v exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:21:52.554Z — error: [ui] git status --untracked-files=all --branch --porcelain=2 -z exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:21:52.591Z — error: [ui] git for-each-ref --format=%(refname)%00%(refname:short)%00%(upstream:short)%00%(objectname)%00%(author)%00%(committer)%00%(parent)%00%(symref)%00%(subject)%00%(body)%00%(trailers:unfold,only)%00%1F refs/heads refs/remotes exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:21:52.699Z — error: [ui] git remote -v exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:21:52.759Z — error: [ui] git remote -v exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:23:00.612Z — error: [ui] git status --untracked-files=all --branch --porcelain=2 -z exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:23:00.674Z — error: [ui] git for-each-ref --format=%(refname)%00%(refname:short)%00%(upstream:short)%00%(objectname)%00%(author)%00%(committer)%00%(parent)%00%(symref)%00%(subject)%00%(body)%00%(trailers:unfold,only)%00%1F refs/heads refs/remotes exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:23:00.790Z — error: [ui] git remote -v exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:23:18.587Z — error: [ui] git status --untracked-files=all --branch --porcelain=2 -z exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:23:18.645Z — error: [ui] git for-each-ref --format=%(refname)%00%(refname:short)%00%(upstream:short)%00%(objectname)%00%(author)%00%(committer)%00%(parent)%00%(symref)%00%(subject)%00%(body)%00%(trailers:unfold,only)%00%1F refs/heads refs/remotes exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:23:18.826Z — error: [ui] git remote -v exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:25:07.416Z — error: [ui] git status --untracked-files=all --branch --porcelain=2 -z exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:25:07.465Z — error: [ui] git for-each-ref --format=%(refname)%00%(refname:short)%00%(upstream:short)%00%(objectname)%00%(author)%00%(committer)%00%(parent)%00%(symref)%00%(subject)%00%(body)%00%(trailers:unfold,only)%00%1F refs/heads refs/remotes exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:25:07.583Z — error: [ui] git remote -v exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:25:11.117Z — error: [ui] git status --untracked-files=all --branch --porcelain=2 -z exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:25:11.177Z — error: [ui] git for-each-ref --format=%(refname)%00%(refname:short)%00%(upstream:short)%00%(objectname)%00%(author)%00%(committer)%00%(parent)%00%(symref)%00%(subject)%00%(body)%00%(trailers:unfold,only)%00%1F refs/heads refs/remotes exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:25:11.305Z — error: [ui] git remote -v exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:26:27.821Z — error: [ui] git status --untracked-files=all --branch --porcelain=2 -z exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:26:27.876Z — error: [ui] git for-each-ref --format=%(refname)%00%(refname:short)%00%(upstream:short)%00%(objectname)%00%(author)%00%(committer)%00%(parent)%00%(symref)%00%(subject)%00%(body)%00%(trailers:unfold,only)%00%1F refs/heads refs/remotes exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:26:28.000Z — error: [ui] git remote -v exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:27:47.342Z — error: [ui] git status --untracked-files=all --branch --porcelain=2 -z exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:27:47.392Z — error: [ui] git for-each-ref --format=%(refname)%00%(refname:short)%00%(upstream:short)%00%(objectname)%00%(author)%00%(committer)%00%(parent)%00%(symref)%00%(subject)%00%(body)%00%(trailers:unfold,only)%00%1F refs/heads refs/remotes exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:27:47.501Z — error: [ui] git remote -v exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:29:08.079Z — error: [ui] git status --untracked-files=all --branch --porcelain=2 -z exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:29:08.133Z — error: [ui] git for-each-ref --format=%(refname)%00%(refname:short)%00%(upstream:short)%00%(objectname)%00%(author)%00%(committer)%00%(parent)%00%(symref)%00%(subject)%00%(body)%00%(trailers:unfold,only)%00%1F refs/heads refs/remotes exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

2018-07-18T06:29:08.253Z — error: [ui] git remote -v exited with an unexpected code: 128.
fatal: not a git repository (or any of the parent directories): .git

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Git error does not have a commit checked out
  • Git error did not match any files
  • Git error could not apply
  • Git error command git clone
  • Git error cannot lock ref unable to update local ref

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии