0

I have made my private repository public so my SMTP server blocked my account because I had the API KEY inside one of the files (.env - it is a Symfony project).

I followed the steps on git hub Remove sensive data to remove sensitive data up until step 8 included.

All the commands were executed on the cloned repository (I am not even sure if this was correct). The cloned repo and github repo is clean of sensitive data.

On my remote server (Scaleway) I had deleted a file before doing these steps (mistake). Remote server :git status gives me this :

On branch master
Your branch and 'origin/master' have diverged,
and have 84 and 84 different commits each, respectively.
  (use "git pull" to merge the remote branch into yours)

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        deleted:    public/uploads/images/logo_linxea-5f82e58f42913.png

no changes added to commit (use "git add" and/or "git commit -a")

If I try on remote server git rebase -- interactive as suggested Here I get the following :

Cannot rebase: You have unstaged changes.
Please commit or stash them.

Questions:

I am not sure if I have to continue working now on cloned repo (on local), original local repo or Remote repo for the steps 9 and 10. How to sync the remote repo with github repo, and the local original repo with the github repo without resending all the removed sensitive information.

I need to keep the .env file on the Remote Server so my emails keep working.

Bogdan
  • 321
  • 1
  • 6

1 Answers1

0

Well I tried something seems to work

On Remote Server :

git reset --hard HEAD

Then

git clean -df

Then

git rebase --interactive (where I just exited) Got this message:

Successfully rebased and updated refs/heads/master.

Then recreated .env file on remote server because it was deleted in the process

Bogdan
  • 321
  • 1
  • 6