I am not sure why i am getting this error again and again, please help me out and correct me if i am doing something wrong in giving the commands.
Thank you in Advance
Please read the caveat in the link above for situation if certain repo branch is already fetched by others. Of course this situation does not apply in KKE environment. Right?
[root@ststor01 blog]# git log --oneline
3d70d31 (HEAD -> master, origin/master, origin/HEAD) Test Commit10
c17f146 Test Commit9
6e60798 Test Commit8
b9cab4c Test Commit7
0aa9d30 Test Commit6
80b61c6 Test Commit5
d1cad97 Test Commit4
60796a3 Test Commit3
c21d31b Test Commit2
0874829 Test Commit1
6acd11a added data.txt file
b4221ce initial commit
[root@ststor01 blog]# git reset --hard HEAD~10
HEAD is now at 6acd11a added data.txt file
[root@ststor01 blog]# git log --oneline
6acd11a (HEAD -> master) added data.txt file
b4221ce initial commit
[root@ststor01 blog]# git push
To /opt/blog.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to '/opt/blog.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
[root@ststor01 blog]# git push --force
Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
To /opt/blog.git
+ 3d70d31...6acd11a master -> master (forced update)
[root@ststor01 blog]# git pull
Already up to date.
[root@ststor01 blog]# git log --oneline
6acd11a (HEAD -> master, origin/master, origin/HEAD) added data.txt file
b4221ce initial commit
[root@ststor01 blog]#
Will this pass the Task validation? I don’t know. I have yet to do this Task.
So, the only mistake i had doing here is that I had been simply using “git push” to upload the changes that i had made to the repository. Instead of that i should had to push the changes forcefully to the repository by using command “git push --force”.