I want to commit a file to master with git, I have followed this link: How to push certain files to origin/master in git?
Now when I push my changes, get error. How can I fix it?
$ git checkout master
M project/Build.scala
M project/plugins.sbt
A XX/src/main/resources/a.properties
M XX/src/main/resources/project.conf
D XX/src/main/scala/X.scala
M XX/src/test/scala/Y.scala
Switched to branch 'master'
Your branch is ahead of 'origin/master' by 8 commits.
(use "git push" to publish your local commits)
$ git push
Password for 'https://CCC@ibgit.com:8443':
To https://CCC@ibgit.com:8443/scm/xxx.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://CCC@ibgit.com:8443/scm/xxx.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first 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.
$ git pull
error: Cannot pull with rebase: You have unstaged changes.
error: Additionally, your index contains uncommitted changes.