Reputation: 3660
Consider this folder structure in repository
Root
|----Plugins
|----|-----Plugin1
|----Themes
|-----|----Theme1
I have all the code pushed into the server. I have some local changes in Plugin1 folder which I have not committed and I don't want to right now. I have some changes in Theme1 folder which I need to commit. I can commit it all right, but when I push it complains me to do a pull or stash my changes. Isnt there an easy option to push changes of just one folder than having to worry about all the local changes in different folders under same repository? In SVN I can just individual checkin any files without worrying about the others.
Upvotes: 0
Views: 51
Reputation: 8529
Of course you can git stash
your change, this is the easiest and the fastest.
However, you can also choose to commit your WIP to a new branch, on which you will do development work until it is pushable to the world (at which point you will want to rebase/merge it on your mainline branch, then push your mainline branch).
Summary :
git add
+ git commit
your soon-to-be-pushed modificationsgit stash
git stash pop
dev
git add
+ git commit
your soon-to-be-pushed modificationsgit checkout -b notready
git add
+ git commit
your WIP modificationsgit checkout dev
git checkout notready
Upvotes: 0
Reputation: 301337
git stash
IS the easy option. After doing the commit, stash, pull, push and then pop the stash.
Upvotes: 4