Posts filed under "Git"

Tracking Changes in Git

I've always heard people refer to creating 'tracking branches' but never really knew how to set one up. I think I've figured it out - here's my current workflow:

  $ git clone my_git_repo
  $ git remote add other_source other_git_repo
  $ git fetch other_source
  $ git branch --track other_source_master other_source/master

Once I have that set up, I can integrate others' changes:

  $ git checkout master
  $ git checkout -b merge_area
  $ git merge other_source_master

Any time I want to pull upstream changes from the other remote source:

  $ git checkout other_source_master
  $ git pull