I have a local WordPress setup, and I used to push only my theme and plugin folder to a local repo, left the other files as they are. Now I have changed the remote, and want to do the same thing, meaning, just push my plugin and theme folder to the remote. But since they were already committed and pushed to my local repo, I cannot see them using git status
. How would I force push them to my new remote repository?
Asked
Active
Viewed 74 times
1

Rutwick Gangurde
- 4,772
- 11
- 53
- 87
1 Answers
3
Even if they are already committed, you still can push to the new remote:
git push origin master
If origin refers to a new remote which doesn't have those commits yet, the push will proceed.
That will, however, push commits, not folders.
-
But those folders were already pushed to my local repository. Hence they are not even listed when I do a `git status`. Will it still work? I want only those 2 folders to be pushed to the new remote. – Rutwick Gangurde Aug 24 '15 at 07:20
-
@RutwickGangurde If the new remote has not those commits, yes, it will push them. Do a `git fetch` first to see if the `git status` is modified. (Assuming the remote you have changed is named '`origin`') – VonC Aug 24 '15 at 07:20