Sunday, March 22, 2015

Git: Updating a forked repository from the original repository

Let's take a scenario:

This is the remote repository:
Your forked repository from the above:

'development' is the branch name both in remote and forked repository.

1. Add remote repository to forked repository
>git remote add upstream

2.  Fetch from remote repository .i.e upstream
> git fetch upstream

3. Rest your branch(ex: development) to the remote branch(ex: development)
> git reset --hard upstream/development

4. Pushed changes which we got it form remote repo to remote forked repo.
> git push origin  development --force

No comments:

Post a Comment