I am quite new to git, and I had been working on a small side project for the last 2 months and had been pushing stuff onto bitbucket with no problems. A couple of days ago,
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
I had the exact same problem. Nothing helped untill I tried this:
git pull --rebase origin master
After that, run push command i.e.
git push -u origin master
SOLVED FOR ME!!
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.
You can try git pull, after that git commit in studio, and after that git push origin branch name.