The proper way of syncing is pretty simple (may be not simple as delete/fork method). Let me explain this in two steps.
1. Configure remote repo for our fork
git remote -v command will list the existing remote repositories.
udara@udara-home:~/wso2/git/fork/carbon-apimgt$ git remote -vYou can add a new remote repository by providing git remote add upstream command.
origin git@github.com:udarakr/carbon-apimgt.git (fetch)
origin git@github.com:udarakr/carbon-apimgt.git (push)
udara@udara-home:~/wso2/git/fork/carbon-apimgt$ git remote add upstream git@github.com:wso2/carbon-apimgt.gitNow if I run the git remote -v command again,
udara@udara-home:~/wso2/git/fork/carbon-apimgt$ git remote -v2. In order to sync your fork run git fetch upstream command.upstream is the name you provided earlier while configuring the remote.
origin git@github.com:udarakr/carbon-apimgt.git (fetch)
origin git@github.com:udarakr/carbon-apimgt.git (push)
upstream git@github.com:wso2/carbon-apimgt.git (fetch)
upstream git@github.com:wso2/carbon-apimgt.git (push)
udara@udara-home:~/wso2/git/fork/carbon-apimgt$ git fetch upstreamMake sure you switch to the correct branch (in my exercise it's release-2.0.0) . You can verify that by running git branch -a command.
remote: Counting objects: 355, done.
remote: Compressing objects: 100% (173/173), done.
remote: Total 355 (delta 48), reused 5 (delta 5), pack-reused 80
Receiving objects: 100% (355/355), 256.29 KiB | 56.00 KiB/s, done.
Resolving deltas: 100% (53/53), done.
From github.com:wso2/carbon-apimgt
* [new branch] master -> upstream/master
* [new branch] release-1.3.0 -> upstream/release-1.3.0
* [new branch] release-1.3.1 -> upstream/release-1.3.1
* [new branch] release-1.3.2 -> upstream/release-1.3.2
* [new branch] release-1.3.3 -> upstream/release-1.3.3
* [new branch] release-1.9.0 -> upstream/release-1.9.0
* [new branch] release-2.0.0 -> upstream/release-2.0.0
Now run git merge upstream/release-2.0.0. this makes my local release-2.0.0 branch sync with the upstream repository.
udara@udara-home:~/wso2/git/fork/carbon-apimgt$ git merge upstream/release-2.0.0
Updating a68742d..4000cbd
Fast-forward
.../org/wso2/carbon/apimgt/api/APIProvider.java | 29 ++
.../wso2/carbon/apimgt/impl/APIProviderImpl.java | 466 ++++++++++++++++++++-
.../src/main/resources/config/rxts/api.rxt | 107 ++---
.../resources/apipublisher/scripts/apipublisher.js | 29 +-
4 files changed, 548 insertions(+), 83 deletions(-)
No comments:
Post a Comment