简体   繁体   中英

Git - Push a folder after changing the remote?

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?

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM