If you created a local branch before the subversion branch exists, and now you want to direct your local branch to the subversion branch, you can do the following:
Create svn branch from revision created by your local branch
$ svn cp http: // svn-repo / my_app / trunk @ 123 http: // svn-repo / my_app / branches / feature1
Check out the new svn branch to let your git report know about it
$ git svn fetch
Now the svn branch should be added as remote in your git repository
$ git branch -a
* feature1
master
remotes / feature1
At this point, your remote will still be trunked. You need to point your local branch to the new remote branch. This can be done by reinstalling the local branch from the remote branch:
$ git rebase remotes / feature1
Now that your local branch belongs to your remote branch, you can commit your changes to it. Make a dry run first to make sure your changes go to your remote branch:
$ git svn dcommit --dry-run
Commiting to http: // svn-repo / my_app / branches / feature1
Now you can make changes to the remote branch
$ git svn dcommit
Most of the instructions will tell you about starting a branch subversion, and then create a local branch that tracks the remote branch. But I often donβt decide in advance whether my local branch should monitor the remote branch. Often I deploy locally and make changes without the intention of moving to a remote branch. If later I decide to transfer the local branch to the remote branch, follow these steps.
pestrella Mar 23 2018-12-23T00: 00Z
source share