git rejected push non-fast-forward

谁说胖子不能爱 提交于 2019-11-28 06:31:08

There are changes in the central repository that you must pull before you can push. Do

git add -A
git commit -m "my local changes" 
git pull

Resolve any conflicts. Then do

git push

Alternatively, if you have no valuable modifications locally, you can create a new clone of your repo, and start working from there:

git clone https://johnsproject@bitbucket.org/johnsproject/proj.git new_repo_dir

Try doing

git pull origin master
git add -A
git commit -m "modified code"
git push origin master

Your local repository is likely out of sync with the remote repository.

Marcell Almeida

I had the same problem. I fixed by using the git push -f command which forces the update.

works for me git push --set-upstream origin master -f

in my case was new file from git repository not added, and this was the solution 1. git status (just to check) 2. git add . 3. git push -u master origin

You can try git pull, after that git commit in studio, and after that git push origin branch name.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!