“fatal: Not a git repository (or any of the parent directories)” from git status

后端 未结 13 2247
深忆病人
深忆病人 2020-12-04 14:54

This command works to get the files and compile them:

git clone a-valid-git-url

for example:

git clone git://cfdem.git.sour         


        
相关标签:
13条回答
  • 2020-12-04 15:30
    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


    0 讨论(0)
  • 2020-12-04 15:30

    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

    0 讨论(0)
  • 2020-12-04 15:34

    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

    0 讨论(0)
  • 2020-12-04 15:34

    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.

    0 讨论(0)
  • 2020-12-04 15:35

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

    0 讨论(0)
  • 2020-12-04 15:39

    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.

    0 讨论(0)
提交回复
热议问题