git unable to push after commiting the changes











up vote
1
down vote

favorite












I am trying to push the committed files into git bitbucket. My remote name is pb and branch name is Pr_1. So I have done git push pb. But it is giving me error saying it is rejected.



Commands used:



git push pb
Username for 'https://<bitbucket name>' : abc@xyz.com
Password for 'https://<bitbucket name>' : ***


Error result :



To https:<bitbucket clone link>
! [rejected] Pr_1 -> Pr_1 (non-fast-forward)
error: Error in sending some references after'https://<bitbucket clone link>'
Note: Updates have been rejected because the top of your current
Note: Branches has fallen behind its external counterpart. Run
Note: The external changes together (e.g. ' git pull ... ') before you "push "
Note: Run again.
Note: See also the section ' Note about fast-forwards ' in ' git push--help '
Note: For more details.


Also, tried as per hints in the error result and did push again.
enter image description here
Why am I unable to push the changes which I have committed? How can my push be reflected in bit bucket?



enter image description here










share|improve this question




















  • 4




    If you read carefully the hints git tries to give you (not in the clearest way ever, granted) you'll see that the remote version of your branch has some commits which aren't known to your local version of it. You should first pull changes (and resolve the potential conflicts) then push yours.
    – RomainValeri
    Nov 8 at 11:25












  • as added above, I have done git pull nut everything is already up-to-date
    – Priya
    Nov 8 at 11:35










  • Possible duplicate of How to resolve git error: "Updates were rejected because the tip of your current branch is behind"
    – kowsky
    Nov 8 at 11:36










  • Nope.. Not at all.. It is not the same
    – Priya
    Nov 8 at 11:59















up vote
1
down vote

favorite












I am trying to push the committed files into git bitbucket. My remote name is pb and branch name is Pr_1. So I have done git push pb. But it is giving me error saying it is rejected.



Commands used:



git push pb
Username for 'https://<bitbucket name>' : abc@xyz.com
Password for 'https://<bitbucket name>' : ***


Error result :



To https:<bitbucket clone link>
! [rejected] Pr_1 -> Pr_1 (non-fast-forward)
error: Error in sending some references after'https://<bitbucket clone link>'
Note: Updates have been rejected because the top of your current
Note: Branches has fallen behind its external counterpart. Run
Note: The external changes together (e.g. ' git pull ... ') before you "push "
Note: Run again.
Note: See also the section ' Note about fast-forwards ' in ' git push--help '
Note: For more details.


Also, tried as per hints in the error result and did push again.
enter image description here
Why am I unable to push the changes which I have committed? How can my push be reflected in bit bucket?



enter image description here










share|improve this question




















  • 4




    If you read carefully the hints git tries to give you (not in the clearest way ever, granted) you'll see that the remote version of your branch has some commits which aren't known to your local version of it. You should first pull changes (and resolve the potential conflicts) then push yours.
    – RomainValeri
    Nov 8 at 11:25












  • as added above, I have done git pull nut everything is already up-to-date
    – Priya
    Nov 8 at 11:35










  • Possible duplicate of How to resolve git error: "Updates were rejected because the tip of your current branch is behind"
    – kowsky
    Nov 8 at 11:36










  • Nope.. Not at all.. It is not the same
    – Priya
    Nov 8 at 11:59













up vote
1
down vote

favorite









up vote
1
down vote

favorite











I am trying to push the committed files into git bitbucket. My remote name is pb and branch name is Pr_1. So I have done git push pb. But it is giving me error saying it is rejected.



Commands used:



git push pb
Username for 'https://<bitbucket name>' : abc@xyz.com
Password for 'https://<bitbucket name>' : ***


Error result :



To https:<bitbucket clone link>
! [rejected] Pr_1 -> Pr_1 (non-fast-forward)
error: Error in sending some references after'https://<bitbucket clone link>'
Note: Updates have been rejected because the top of your current
Note: Branches has fallen behind its external counterpart. Run
Note: The external changes together (e.g. ' git pull ... ') before you "push "
Note: Run again.
Note: See also the section ' Note about fast-forwards ' in ' git push--help '
Note: For more details.


Also, tried as per hints in the error result and did push again.
enter image description here
Why am I unable to push the changes which I have committed? How can my push be reflected in bit bucket?



enter image description here










share|improve this question















I am trying to push the committed files into git bitbucket. My remote name is pb and branch name is Pr_1. So I have done git push pb. But it is giving me error saying it is rejected.



Commands used:



git push pb
Username for 'https://<bitbucket name>' : abc@xyz.com
Password for 'https://<bitbucket name>' : ***


Error result :



To https:<bitbucket clone link>
! [rejected] Pr_1 -> Pr_1 (non-fast-forward)
error: Error in sending some references after'https://<bitbucket clone link>'
Note: Updates have been rejected because the top of your current
Note: Branches has fallen behind its external counterpart. Run
Note: The external changes together (e.g. ' git pull ... ') before you "push "
Note: Run again.
Note: See also the section ' Note about fast-forwards ' in ' git push--help '
Note: For more details.


Also, tried as per hints in the error result and did push again.
enter image description here
Why am I unable to push the changes which I have committed? How can my push be reflected in bit bucket?



enter image description here







git bitbucket






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 8 at 11:34

























asked Nov 8 at 11:21









Priya

346




346








  • 4




    If you read carefully the hints git tries to give you (not in the clearest way ever, granted) you'll see that the remote version of your branch has some commits which aren't known to your local version of it. You should first pull changes (and resolve the potential conflicts) then push yours.
    – RomainValeri
    Nov 8 at 11:25












  • as added above, I have done git pull nut everything is already up-to-date
    – Priya
    Nov 8 at 11:35










  • Possible duplicate of How to resolve git error: "Updates were rejected because the tip of your current branch is behind"
    – kowsky
    Nov 8 at 11:36










  • Nope.. Not at all.. It is not the same
    – Priya
    Nov 8 at 11:59














  • 4




    If you read carefully the hints git tries to give you (not in the clearest way ever, granted) you'll see that the remote version of your branch has some commits which aren't known to your local version of it. You should first pull changes (and resolve the potential conflicts) then push yours.
    – RomainValeri
    Nov 8 at 11:25












  • as added above, I have done git pull nut everything is already up-to-date
    – Priya
    Nov 8 at 11:35










  • Possible duplicate of How to resolve git error: "Updates were rejected because the tip of your current branch is behind"
    – kowsky
    Nov 8 at 11:36










  • Nope.. Not at all.. It is not the same
    – Priya
    Nov 8 at 11:59








4




4




If you read carefully the hints git tries to give you (not in the clearest way ever, granted) you'll see that the remote version of your branch has some commits which aren't known to your local version of it. You should first pull changes (and resolve the potential conflicts) then push yours.
– RomainValeri
Nov 8 at 11:25






If you read carefully the hints git tries to give you (not in the clearest way ever, granted) you'll see that the remote version of your branch has some commits which aren't known to your local version of it. You should first pull changes (and resolve the potential conflicts) then push yours.
– RomainValeri
Nov 8 at 11:25














as added above, I have done git pull nut everything is already up-to-date
– Priya
Nov 8 at 11:35




as added above, I have done git pull nut everything is already up-to-date
– Priya
Nov 8 at 11:35












Possible duplicate of How to resolve git error: "Updates were rejected because the tip of your current branch is behind"
– kowsky
Nov 8 at 11:36




Possible duplicate of How to resolve git error: "Updates were rejected because the tip of your current branch is behind"
– kowsky
Nov 8 at 11:36












Nope.. Not at all.. It is not the same
– Priya
Nov 8 at 11:59




Nope.. Not at all.. It is not the same
– Priya
Nov 8 at 11:59












1 Answer
1






active

oldest

votes

















up vote
1
down vote



accepted










Priya, the answer is actually similar to what is mentioned in the question tagged by @kowsky. How ever let me try to explain what is happening.



What git is trying to tell you is the Pr_1 branch has changed on the server and your common commit is no longer the HEAD of remote repository. This must be because of one of the following reasons, and solution is different based on the situation:

1. You must be amending the last commit before pushing it

Solution: In this case you will have to force push your changes git push pb Pr_1 --force(before that be absolutely sure that there are no other commits pushed to remote)


2. Someone else must have pushed changes on Pr_1 while you were making changes

Solution: Take and update git pull pb Pr_1 if there are conflicts resolve them and then push git push pb Pr_1






share|improve this answer





















  • Your solution worked as a miracle for me. What you explained is true. Actually, it was very useful. Thank you so much :) I tried using "rebase" as mentioned in the other question. But it did not work. so I was stating it is different. I now get it clearly. But I did not amend the last commit before pushing. I committed the new changes and tried to push without editing any further. But the possible error should be that there are more commits pushed to remote.
    – Priya
    Nov 8 at 14:59











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53206729%2fgit-unable-to-push-after-commiting-the-changes%23new-answer', 'question_page');
}
);

Post as a guest
































1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote



accepted










Priya, the answer is actually similar to what is mentioned in the question tagged by @kowsky. How ever let me try to explain what is happening.



What git is trying to tell you is the Pr_1 branch has changed on the server and your common commit is no longer the HEAD of remote repository. This must be because of one of the following reasons, and solution is different based on the situation:

1. You must be amending the last commit before pushing it

Solution: In this case you will have to force push your changes git push pb Pr_1 --force(before that be absolutely sure that there are no other commits pushed to remote)


2. Someone else must have pushed changes on Pr_1 while you were making changes

Solution: Take and update git pull pb Pr_1 if there are conflicts resolve them and then push git push pb Pr_1






share|improve this answer





















  • Your solution worked as a miracle for me. What you explained is true. Actually, it was very useful. Thank you so much :) I tried using "rebase" as mentioned in the other question. But it did not work. so I was stating it is different. I now get it clearly. But I did not amend the last commit before pushing. I committed the new changes and tried to push without editing any further. But the possible error should be that there are more commits pushed to remote.
    – Priya
    Nov 8 at 14:59















up vote
1
down vote



accepted










Priya, the answer is actually similar to what is mentioned in the question tagged by @kowsky. How ever let me try to explain what is happening.



What git is trying to tell you is the Pr_1 branch has changed on the server and your common commit is no longer the HEAD of remote repository. This must be because of one of the following reasons, and solution is different based on the situation:

1. You must be amending the last commit before pushing it

Solution: In this case you will have to force push your changes git push pb Pr_1 --force(before that be absolutely sure that there are no other commits pushed to remote)


2. Someone else must have pushed changes on Pr_1 while you were making changes

Solution: Take and update git pull pb Pr_1 if there are conflicts resolve them and then push git push pb Pr_1






share|improve this answer





















  • Your solution worked as a miracle for me. What you explained is true. Actually, it was very useful. Thank you so much :) I tried using "rebase" as mentioned in the other question. But it did not work. so I was stating it is different. I now get it clearly. But I did not amend the last commit before pushing. I committed the new changes and tried to push without editing any further. But the possible error should be that there are more commits pushed to remote.
    – Priya
    Nov 8 at 14:59













up vote
1
down vote



accepted







up vote
1
down vote



accepted






Priya, the answer is actually similar to what is mentioned in the question tagged by @kowsky. How ever let me try to explain what is happening.



What git is trying to tell you is the Pr_1 branch has changed on the server and your common commit is no longer the HEAD of remote repository. This must be because of one of the following reasons, and solution is different based on the situation:

1. You must be amending the last commit before pushing it

Solution: In this case you will have to force push your changes git push pb Pr_1 --force(before that be absolutely sure that there are no other commits pushed to remote)


2. Someone else must have pushed changes on Pr_1 while you were making changes

Solution: Take and update git pull pb Pr_1 if there are conflicts resolve them and then push git push pb Pr_1






share|improve this answer












Priya, the answer is actually similar to what is mentioned in the question tagged by @kowsky. How ever let me try to explain what is happening.



What git is trying to tell you is the Pr_1 branch has changed on the server and your common commit is no longer the HEAD of remote repository. This must be because of one of the following reasons, and solution is different based on the situation:

1. You must be amending the last commit before pushing it

Solution: In this case you will have to force push your changes git push pb Pr_1 --force(before that be absolutely sure that there are no other commits pushed to remote)


2. Someone else must have pushed changes on Pr_1 while you were making changes

Solution: Take and update git pull pb Pr_1 if there are conflicts resolve them and then push git push pb Pr_1







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 8 at 13:58









Mudassir Razvi

1,213720




1,213720












  • Your solution worked as a miracle for me. What you explained is true. Actually, it was very useful. Thank you so much :) I tried using "rebase" as mentioned in the other question. But it did not work. so I was stating it is different. I now get it clearly. But I did not amend the last commit before pushing. I committed the new changes and tried to push without editing any further. But the possible error should be that there are more commits pushed to remote.
    – Priya
    Nov 8 at 14:59


















  • Your solution worked as a miracle for me. What you explained is true. Actually, it was very useful. Thank you so much :) I tried using "rebase" as mentioned in the other question. But it did not work. so I was stating it is different. I now get it clearly. But I did not amend the last commit before pushing. I committed the new changes and tried to push without editing any further. But the possible error should be that there are more commits pushed to remote.
    – Priya
    Nov 8 at 14:59
















Your solution worked as a miracle for me. What you explained is true. Actually, it was very useful. Thank you so much :) I tried using "rebase" as mentioned in the other question. But it did not work. so I was stating it is different. I now get it clearly. But I did not amend the last commit before pushing. I committed the new changes and tried to push without editing any further. But the possible error should be that there are more commits pushed to remote.
– Priya
Nov 8 at 14:59




Your solution worked as a miracle for me. What you explained is true. Actually, it was very useful. Thank you so much :) I tried using "rebase" as mentioned in the other question. But it did not work. so I was stating it is different. I now get it clearly. But I did not amend the last commit before pushing. I committed the new changes and tried to push without editing any further. But the possible error should be that there are more commits pushed to remote.
– Priya
Nov 8 at 14:59


















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53206729%2fgit-unable-to-push-after-commiting-the-changes%23new-answer', 'question_page');
}
);

Post as a guest




















































































Popular posts from this blog

Guess what letter conforming each word

Port of Spain

Run scheduled task as local user group (not BUILTIN)