Pushing only one folder to remote repo

前端 未结 4 2111
遥遥无期
遥遥无期 2020-12-15 20:41

I\'m using Git 1.7.4.1. I want to push commits I did on one folder to my remote repo. How do I push only changes from one folder to my remote repo? All the documentation

4条回答
  •  旧巷少年郎
    2020-12-15 20:58

    Git is not like subversion. The short answer is, you can't.

    You should consider rebasing your change (only the one relevant) against the remote

    git rebase -i origin/trunk
    

    should get you underway. Be sure to read the comments and instructions along the way. There is also man git-rebase of course.

    In the end, when you are satisfied with the result, you can either create a new branch from there

     git checkout -b rebased HEAD
    

    or you can opt to make it your new master. I'll leave it up to you how to manage your branches locally (because you didn't tell us about them).

    Pushing woud then be easy with

     git push origin trunk
    

提交回复
热议问题