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.
Why am I unable to push the changes which I have committed? How can my push be reflected in bit bucket?
git bitbucket
add a comment |
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.
Why am I unable to push the changes which I have committed? How can my push be reflected in bit bucket?
git bitbucket
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
add a comment |
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.
Why am I unable to push the changes which I have committed? How can my push be reflected in bit bucket?
git bitbucket
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.
Why am I unable to push the changes which I have committed? How can my push be reflected in bit bucket?
git bitbucket
git bitbucket
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
add a comment |
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
add a comment |
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
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
add a comment |
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
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
add a comment |
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
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
add a comment |
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
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
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
add a comment |
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
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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