문제

Yesterday i did some deleting and removed too much (ye i know typical case). Upon reading blogs about smartgit i resetted to the revision where i left off before all the deletes. I got my old files back but git does not detect them being there so i'm unable to push them to my server again. Any ideas? I tried looking in gitignore file and in the excludes in the info folder but nothing is there -edit- i already tried a force push.

The steps I used are

- Going to logs
- Select the revision
- Press ctr+R (reset)
- Selected hard reset and confirmed
도움이 되었습니까?

해결책 2

I needed to force pulling all the files back to my server, i found a stackoverflow post for this:

How do I force git pull to overwrite everything on every pull?

And what i did was:

git fetch origin master
git reset --hard FETCH_HEAD
git clean -df

Added the code for future reference

다른 팁

Let's say you had commits: A->B->C->D The D commit was the one where you deleted too much. So you checked out C again. Of course, git detects the files, but since there aren't changed since C which you're looking at, git status won't show you anything.

A push will fail since you're trying to rewrite history of the remote, you need to do a git push -f (that's -f for --force see https://www.kernel.org/pub/software/scm/git/docs/git-push.html )

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top