Git - Working Remotely

From Training Material
Revision as of 16:10, 23 January 2015 by Bernard Szlachta (talk | contribs) (→‎Getting new Changes)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


Staging Changes

Git-stag-change.PNG

Getting Existing Repo

git clone  http://git.drupal.org/project/pathauto.git
cd pathauto
git remote -v


git branch -a
* 7.x-1.x
 remotes/origin/4.6.x-1.x
 remotes/origin/4.7.x-1.x
 remotes/origin/5.x-1.x
 remotes/origin/5.x-2.x
 remotes/origin/6.x-1.x
 remotes/origin/6.x-2.x
 remotes/origin/7.x-1.x
 remotes/origin/HEAD -> origin/7.x-1.x
 remotes/origin/MAIN
 remotes/origin/master


Getting new Changes

git pull gituser@git.nobleprog.net:/gitrepo/pathauto

Create local tracking branch

git checkout -b version5 origin/5.x-2.x

Push Changes to central repo

echo Change in readme >> README.txt 
git commit -a
git push
git push gituser@git.nobleprog.net:/gitrepo/pathauto

Adding Remote

git remote add central  gituser@git.nobleprog.net:/gitrepo/pathauto
git pull central 7.x-1.x
git push central 7.x-1.x


Exercises

  1. Clone the http://git.drupal.org/project/pathauto.git
  2. Make sure you are on the 7.x-1.x
  3. Add a remote gituser@git.nobleprog.net:/gitrepo/pathauto, call it central
  4. Pull changes from central from 7.x-1.x branch
  5. Modify a file
  6. Push your changes to central