Git clone leads to deleted & untracked files

git restore deleted file from repository
git restore locally deleted file
accidentally deleted git folder
delete git repository command line
git pull deleted file
git deleted files
git restore deleted folder
git file modified after checkout

I am new to Git.

I just installed Git (2.9.3) for Windows (10), then I opened git-bash and did a git clone <remoteURL>. A new folder is created with the whole copy of the remote repository, which is good. But then I run a git status and I get a ton of deleted files (I suppose all the files that just got copied) ready to be committed, and the three main folders under the repository folder are untracked. The deleted files actually exist on my drive though!

I am pretty sure my git status should be clean instead. What is happening?

This about deleted files didn't help (I didn't use checkout), neither did this about untracked files (I'm not using Mac OS).

I was retrieving a huge project with very long paths. I forgot to set up Git to use long paths:

git config --global core.longpaths true

After this, the cloning went fine and the status clean.

git status for cloned repository shows file deleted, If I understand you correctly, I assume you are grabbing the repository via a basic clone command like git clone gitRepositoryLink. When you� git version 1.7.3.4 I accidentally deleted the .git folder using. git -rf .git but I have all the files and updates done on online git-hub repository. I want the .git folder restored. Questions ? Am I totally screwed up ? OR ; If theres a way to restore .git from my online git-hub repository, how can that be done ?

It sounds like you've somehow loaded an empty index. The normal way this happens in with the command git read-tree --empty, but that's not something you usually use/know as a new user of git.

Perhaps something went wrong with the clone. It's shouldn't be difficult to fix though, just run

git reset

and the index should be restored to the contents of the latest commit.

git-clone Documentation, If you clone your repository using this option and then delete branches (or use Clone only the history leading to the tip of a single branch, either specified by� Use -D instead if you want to force the branch to be deleted, even if it hasn't been pushed or merged yet. The branch is now deleted locally. Deleting a branch REMOTELY. Here's the command to delete a branch remotely: git push <remote> --delete <branch>. For example: git push origin --delete fix/authentication. The branch is now deleted remotely.

how to uninstall git clone? : git, i have very little experience with git, i can basically run commands a tutorial tells me to do, Yeah I believe you can just delete the folder you cloned it into. I never expected my question to lead me to a better understanding of the rebase� We're introducing git into the situation. A developer lead ran git init, but with default permissions of 750, nobody else can write to it. At the moment we're not asking the devs to make commits, we're doing git "behind the scenes" as a POC for moving code between environments. A lead (but not the one who ran git init) would be doing the commits.

In case you end up here and the longpath property did not work AND you run on Windows and use Git Bash you might have files using reserved keywords in Windows. Ie, I had files with nulin it, and those got deleted after clone. I spent half a day finding it was this reserved keyword thing.

The solution for that is simply renaming the file (on your other machine / OS where you could create it). Push it, and then redo the clone operation on your Windows machine.

git status shows as files modified directly after clones, [user@myhost ~]$ git clone -b release/3.10.2 ssh://git@stash.myhost.com/myproj/ repo.git Cloning into 'repo' remote: Counting objects:� From a bare repo (clone a repository using --mirror option), you can delete branch in mirrored repo and push deletion with --mirror option : $> git clone --mirror <url> $> git branch -D branch_to_delete_1 $> git branch -D branch_to_delete_2 $> git push --mirror It's allow you to delete multiple branches once.

If you experience problems on Windows might check your file names against these forbidden characters:

< (less than) > (greater than) : (colon) " (double quote) / (forward slash) \ (backslash) | (vertical bar or pipe) ? (question mark) * (asterisk)

Or files named with one of the reserved words below or one of these immediately followed by the extension: CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9.

More details can be found here.

GitHub, Else, delete and clone each one of them, one by one (of course that this rm -rf repositoryA git clone git://github.com/myUser/repositoryA.git rm� I am trying to use Cygwin to clone from our company Git server. However, Cygwin uses the external Git bash, which is installed on my machine. This leads to compatibility problems. I have a key in C:\Users\user.ssh and also separate SSH keys in /home/user/.ssh in Cygwin. However, adding verbosity to ssh, I see this,

Git Shallow Clone and Clone Depth – Linux Hint, Now let's delete the current copy and then shallow clone with a depth of 1: $ git clone --depth 1 file:////Users/zakh/git_repo/_example. Cloning into '_example'. Very much a noob when it comes to using git, I can do the basic push/pull/clone from a git repository. Just enough to build the code, but that's about it. I'm terrible when it comes to git CLI and feel more comfortable with a GUI based solution while I'm still learning.

How To Delete a GitHub Repository – devconnected, In some cases, you don't want to delete a remote GitHub repository but you only want to delete the copy you got by cloning the remote� The situtation I have right now is that I have a folder “Java” and inside I placed “Pokemon Arena” folder, which I wanted to turn into it’s own repo. I used this line of code, not knowing what I was doing… _ git filter-branch --prune-empty --subdirectory-filter Pokemon\\ Arena\\ nt/ master _ (master was also the name of my old branch, thinking i’ve rewrote the branch). I then

Oh Shit, Git!?!, git commit --amend # follow prompts to change the commit message last commit to master git cherry-pick master # delete it from master git checkout master git� git svn can track a standard Subversion repository, following the common "trunk/branches/tags" layout, with the --stdlayout option. It can also follow branches and tags in any layout with the -T/-t/-b options (see options to init below, and also the clone command).

Comments
  • Something went very wrong.
  • I use TortoiseHg to access GIT repositories (it has a plugin for that) - works like a charm and the GUI is much friendlier than the command line. If you want to try my advice (you will not regret) - I can further help in the chat.
  • how about git reset ?
  • Did you change the root directory? Rename/remove/change hierarchy?
  • even this doesn't work with git version 2.23.0.windows.1 and Windows 10.
  • The reset lead me on the right way: only deleted files remaining were actually absent on my drive, and they probably had the longest paths. See my answer.
  • git reset fixed it for me. Thanks!
  • A 'git reset' pointed me to a file with spaces and a colon : in it. Deleting the file solved the problem. This should be the accepted answer.
  • I should add that I used the same repository on Linux and Mac without problems. git version on windows (where the problem appeared) is 2.26.0.windows.1
  • This is not an answer, please write here only answers