Error: fatal: refusing to merge unrelated histories
Solution:
-
Rebase it
git pull --rebase branchname
-
pull
git pull origin branchname --allow-unrelated-histories
-
push
git push origin master
Do the following to trigger the gitignore
Step 1: Commit all your pending changes in the repo which you want to fix and push that.
Step 2: Now you need to remove everything from the git index in order to refresh your git repository. This is safe. Use this command:
git rm -r --cached . Step 3: Now you need to add everything back into the repo, which can be done using this command:
git add .
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# ~/.bashrc: executed by bash(1) for non-login shells.
# Note: PS1 and umask are already set in /etc/profile. You should not
# need this unless you want different defaults for root.
# PS1='${debian_chroot:+($debian_chroot)}\h:\w\$ '
# umask 022