Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6549817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:08:23+00:00 2026-05-25T12:08:23+00:00

Solution: Finally realized the problem. Stupid User Error. Forgot to run ‘ git init

  • 0

Solution: Finally realized the problem. Stupid User Error. Forgot to run ‘git init‘ in the new project directory first. Hence, running ‘git add .‘, ‘git remote add origin repo.git‘ (or even the typo ‘git add origin repo.git‘) in a directory without a git repo, will revert to applying the command globally, hence all the parent and other directories in the git status results.


I’ve been using a git for a while and never hit this problem, not sure what’s going on. In a nutshell, using 'git remote add origin git@github.com...' creates a global remote across my entire filesystem, instead of a local one inside the current directory only. It even overwrites the remotes in other lateral directories.

The code is worth a thousand words, anyone know what’s going on here:

prompt:~/bin/Projects$ ls -al
total 56
drwxr-xr-x 15 kurtosis kurtosis 4096 2011-09-09 21:35 .
drwxr-xr-x 26 kurtosis kurtosis 4096 2011-09-09 21:35 ..
drwxr-xr-x  5 kurtosis kurtosis 4096 2011-06-16 13:42 byrongibson.com
drwxr-xr-x  5 kurtosis kurtosis 4096 2011-06-16 13:44 byrongibson.github.com
drwxr-xr-x  3 kurtosis kurtosis 4096 2011-09-09 21:33 know.io
drwxr-xr-x  3 kurtosis kurtosis 4096 2011-06-16 13:45 problem-sets
drwxr-xr-x  2 kurtosis kurtosis 4096 2011-07-18 20:11 vim~
prompt:~/bin/Projects$ git remote -v
prompt:~/bin/Projects$ cd know.io/
prompt:~/bin/Projects/know.io$ ls -al
total 16
drwxr-xr-x  3 kurtosis kurtosis 4096 2011-09-09 21:33 .
drwxr-xr-x 15 kurtosis kurtosis 4096 2011-09-09 21:35 ..
-rw-r--r--  1 kurtosis kurtosis    7 2011-09-09 21:27 README.md
drwxr-xr-x  2 kurtosis kurtosis 4096 2011-09-09 21:27 vim~
prompt:~/bin/Projects/know.io$ git remote -v
prompt:~/bin/Projects/know.io$ git remote add origin git@github.com:byrongibson/know.io.git
prompt:~/bin/Projects/know.io$ git remote -v
origin  git@github.com:byrongibson/know.io.git (fetch)
origin  git@github.com:byrongibson/know.io.git (push)
prompt:~/bin/Projects/know.io$ cd ..
prompt:~/bin/Projects$ git remote -v
origin  git@github.com:byrongibson/know.io.git (fetch)
origin  git@github.com:byrongibson/know.io.git (push)
prompt:~/bin/Projects$ cd ~
prompt:~$ git remote -v
origin  git@github.com:byrongibson/know.io.git (fetch)
origin  git@github.com:byrongibson/know.io.git (push)
prompt:~$ cd bin/Github
prompt:~/bin/Github$ git remote -v
origin  git@github.com:byrongibson/know.io.git (fetch)
origin  git@github.com:byrongibson/know.io.git (push)
prompt:~/bin/Github$ 

Update1: This problem mysteriously went away. No idea what I did or why. If I figure it out, will update with answer.

Update2: I did it again with another repository. This time I think it was because, when I was setting up the repository and adding the remote origin, I made a typo and did this:

> git add origin git@github.com/.../repo.git

E.g., I forgot ‘remote’. That set the global origin in ~/.git/config to:

[remote "origin"]
    url = git@github.com/.../repo.git
    fetch = +refs/heads/*:refs/remotes/origin/*

Deleting that from config removes the global origin, but unfortunately when I cd back into my new repo and use ‘git add .’, it not only adds every file and directory in my repo, but apparently everything outside my repo that’s not in my global .gitignore as well:

prompt:~/bin/Projects/Haskell/Courses/Stanford$ git remote -v
prompt:>~/bin/Projects/Haskell/Courses/Stanford$ git remote add origin git@github.com:byrongibson/stanford-fall2011-cs240h.git
prompt:>~/bin/Projects/Haskell/Courses/Stanford$ git remote -v
origin  git@github.com:byrongibson/stanford-fall2011-cs240h.git (fetch)
origin  git@github.com:byrongibson/stanford-fall2011-cs240h.git (push)
prompt:>~/bin/Projects/Haskell/Courses/Stanford$ git add .
prompt:>~/bin/Projects/Haskell/Courses/Stanford$ ls -al
total 12
drwxr-xr-x 3 byron byron 4096 2011-09-26 18:19 ./
drwxr-xr-x 3 byron byron 4096 2011-09-26 18:19 ../
drwxr-xr-x 2 byron byron 4096 2011-09-26 18:09 Lectures/
prompt:>~/bin/Projects/Haskell/Courses/Stanford$ git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#   new file:   Lectures/basics1-slides.html
#   new file:   Lectures/basics1.html
#   new file:   Lectures/basics1.md
#   new file:   ../../../../btccx/btc.cx/README
#   new file:   ../../../../btccx/btc.cx/README.md
#
# Changed but not updated:
#   (use "git add/rm <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#   modified:   ../../../../../.gitconfig
#   modified:   ../../../../../.profile
#   modified:   ../../../../../Downloads/Keys/chromiumppa_key.html
#   modified:   ../../../../../Downloads/Keys/chromiumppa_key.pub
#   modified:   ../../../../../Downloads/Keys/linux_signing_key.pub
#   modified:   ../../../../../Downloads/Keys/tor-key-install.sh
#   deleted:    ../../../../btccx/btc.cx/README
#   deleted:    ../../../../btccx/btc.cx/README.md
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#   ../../../../../.FBReader/
#   ../../../../../.ICEauthority
#   ../../../../../.Skype/
#   ../../../../../.SpiderOak/
.
.
.
#   ../../../../../Downloads/xmonad-ubuntu.html
#   ../../../../../Downloads/xmonad-ubuntu_files/
#   ../../../../../Dropbox/
#   ../../../../../Music/
#   ../../../../../Pictures/
#   ../../../../../SpiderOak/
#   ../../../../../Ubuntu One/
#   ../../../../../Videos/
#   ../../../../Archive/
#   ../../../../Clients/
#   ../../../../CryptoCurrency/
#   ../../../../Databases/
#   ../../../../Git/
#   ../../../../Go/
#   ../../../../Google/
#   ../../../../Hosts/
#   ../../../99-scala-problems/
#   ../../LYaH/
#   ../../RWH/
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T12:08:24+00:00Added an answer on May 25, 2026 at 12:08 pm

    You would normally get the following error if you run git remote -v outside a git repository:

    $ git remote -v
    fatal: Not a git repository (or any of the parent directories): .git
    

    I would guess that what’s happened is that you accidentally ran git init in your home directory at some point, which would explain what you’re seeing. If you run:

    git rev-parse --show-toplevel
    

    That should show you the top level of the git repository you are actually in.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After many search on the subject I finally think the solution of my problem
Solution to original problem (below) may have been discovered. I commented out <identity> ...
After looking and looking I finally found the solution to one of my questions
I'm pretty new to Python, so hopefully the problem I'm having has a simple
here is the problem, today I had a bad time debugging my project, the
Update and Solution I finally got everything working after 1. Uninstalling everything ruby-related in
Solution: thanks to the suggestion from @Guarav I was inspired and FINALLY came up
Solution -- WorkflowProject   -- Workflow1   -- Workflow2 -- WebProject (WAP)   -- App_Data     -- MyDatabase.vdb3
Solution: I've misinterpreted the example from SQL Books Online. Yes, that below the section
Solution for writing a program for keep secret photos. I have many secret photos

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.