Question

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
Was it helpful?

Solution 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

OTHER TIPS

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 )

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top