0
I am in the development of a system and the situation is as follows: I created some new files on my machine and I want to send to Bitbucket but it will not. When I was creating I was giving out commits, but my colleague in development gave other commits and sent them to Bitbucket before me, which has newer and older commits than his commits
When I give the command git push origin development
, the following message appears:
! [rejected] development -> development (non-fast-forward)
error: failed to push some refs to 'https://[...]/migration.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and integrate the remote changes
hint: (e.g. 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Executed git status
and says there’s nothing to commit.
Executed git pull origin development
and says that everything is already updated.
I am using Bitbucket. I have to send the new files to the server manually?
already tried git pull origin Development ?
– Geilton Xavier Santos de Jesus
I tried... He says that everything is up to date
– Wandré Veloso
already tried to force git push origin --force ?
– Geilton Xavier Santos de Jesus
I used --force but I can’t find the code in the bitbucket. I guess it wasn’t...
– Wandré Veloso
you had commits to climb? your git status still shows something?
– Geilton Xavier Santos de Jesus
When I execute
git status
appears:On branch migration_code_wandre_oo
Your branch and 'origin/migration_code_wandre_oo' have diverged,
and have 21 and 2 different commits each, respectively.
 (use "git pull" to merge the remote branch into yours)
nothing to commit, working directory clean
– Wandré Veloso
try git pull origin migration_code_wandre_oo and then try to push your commits
– Geilton Xavier Santos de Jesus
I don’t know why but now I did. The commands I executed were:
git pull origin migration_code_wandre_oo
git status
git branch
(confirmed it was in the migration_code_wandre_oo)
 branch;git pull
(opened the nano and gave control+x)git push
(now the files have actually been uploaded to Bitbucket) Thank you very much @Geiltonxavier– Wandré Veloso
Cool, I think the problem is that you were treating your migration_code_wandre_oo branch with the wrong name, I realized when you sent me the git status result. I’m glad you solved.
– Geilton Xavier Santos de Jesus