GIT

completely remove .env secret

Fix author on previous commits

usual grind

Git add .
Git commit -m 'message'
Git push

list branch and switch to

Git branch
Git checkout <branchname>
Git init
.gitignore

remove / clean files & directories from remote repo after .gitignore update

  1. git rm -r --cached .
  2. git add .
  3. git commit -m 'Remove newly ignored directory and files'
  4. git push origin master

change branch

remove unwanted add

stash

cd public
git init
git add .

git remote add origin https://github.com/<username>/<repo>.git

git commit -m 'first commit'
git push origin master

git repo inside a git repo?

fix commit author

global login via terminal

git config --global user.name "John Doe"
git config --global user.email johndoe@example.com
git config --global user.password "1234321"
git config --global credential.helper store

or before you push a commit try this out instead

git config credential.helper store
git push http://example.com/repo.git
Username: <type your username>
Password: <type your password>

# several days later
$ git push http://example.com/repo.git
# your credentials are used automatically

'fatal: unable to write new index file'

chmod -RN /path/to/repo

Credits