How can I push certain files to origin/master in Git?
- Create a new branch from master
git checkout master
git checkout -b new_branch
- Checkout just the file you want from your old branch
git checkout old_branch path/to/some/file
- repeat as necessary for additional files
- Commit the files to your new branch
git commit -a
- Push new branch to origin master branch
git push origin new_branch:master
I solved my problem: (I was confused with git status response because it wasn't changed when I tried to add/commit files which were already there).Thanks to linuxdan and DaveZych and Temich.
git checkout -b NewBranch
After that I deleted all unnecessary files.
git rm --cache build/web/WEB-INF/classes/doggizz/utils/\*.class
Move back to master
git checkout master
(only disadvantage that those files were deleted when I moved back to master so I copied manually project file , I tried to stash before checkout but it didn't helped)
git merge NewBranch
git push