I am little bit new to Git. I would like to push some files to my Git origin (remote).
What I did:
I had my master, and I created a branch to do some job. After that I merged my branch to my master. During my work, a lot of binary files and project files were changed/added locally. I would like only to add .java files which changed to remote server.
(I believe that I experimented with commits when I worked on my branch, just to check how it work.)
My master is up to date with my origin (that is what I get when I do git pull
. Also I did git fetch origin
.
I always received (when I ran git status
):
On branch master Your branch is ahead of origin/master by 12 commits.
(use "git push" to publish your local commits)
nothing to commit, working directory clean`
I tried to add, commit those files, but running git status
wasn't changed. I tried to do add, commit on the new branch:
On branch NewBranch nothing to commit, working directory clean
I tried to reset Head. I didn't find a solution for my problem in the Git tutorial or on Stack Overflow.
Of course I can push all files to remote origin, but I don't think it's a good solution.
Some duplicate questions that I found: How to push a single file, how to push changes made to only certain files?, and How to commit only some files?.