User Tools

Site Tools


Sidebar

Launch of Linino.org

wiki:updateupsopwrt

Sync the repository to the upstream code

Before you can sync, you need to add a remote that points to the upstream repository.

linino: ~/linino_distro $ git remote -v
# List the current remotes
origin  git@github.com:linino/linino_distro.git (fetch)
origin  git@github.com:linino/linino_distro.git (push)
 
linino: ~/linino_distro $ git remote add upstream git://git.openwrt.org/12.09/openwrt.git
# Set a new remote 
 
linino: ~/linino_distro $ git remote -v
# Verify new remote
origin  git@github.com:linino/linino_distro.git (fetch)
origin  git@github.com:linino/linino_distro.git (push)
upstream       git://git.openwrt.org/12.09/openwrt.git (fetch)
upstream       git://git.openwrt.org/12.09/openwrt.git (push)

Syncing

There are two steps required to sync your repository with the upstream: first you must fetch from the remote, then you must merge the desired branch into your local branch.

Fetching

Fetching from the remote repository will bring in its branches and their respective commits. These are stored in your local repository under special branches.

linino: ~/linino_distro $ git fetch upstream
# Grab the upstream remote's branches
 remote: Counting objects: 75, done.
 remote: Compressing objects: 100% (53/53), done.
 remote: Total 62 (delta 27), reused 44 (delta 9)
 Unpacking objects: 100% (62/62), done.
 From git://git.openwrt.org/12.09/openwrt.git 
  * [new branch]      master     -> upstream/master

We now have the upstream's master branch stored in a local branch, upstream/master

linino: ~/linino_distro $ git branch -va
# List all local and remote-tracking branches
  master                            8eee045 Allow multi-threaded applications to work properly by removing the no-threads flag that is enabled by default.
* update                            862a565 [ahead 8] Merge remote branch 'upastream/master' into update
  remotes/origin/HEAD               -> origin/master
  remotes/origin/master             8eee045 Allow multi-threaded applications to work properly by removing the no-threads flag that is enabled by default.
  remotes/origin/release            44c85b5 Merge branch 'master' into release
  remotes/upastream/master          c00de5a rt2x00: remove the incompatible 20 mhz clock patch again (fixes #13532)

Merging

Now that we have fetched the upstream repository, we want to merge its changes into our local branch. This will bring that branch into sync with the upstream, without losing our local changes.

git checkout master
# Check out our local master branch
# Switched to branch 'master'
 
git merge upstream/master
# Merge upstream's master into our own
/var/www/wiki.linino.org/data/pages/wiki/updateupsopwrt.txt · Last modified: 2014/03/21 20:29 by administrator

2014 © dog hunter llc and the Linino Community. Linino.org is a dog hunter sponsored community project. Credits