Git - Working Remotely
Jump to navigation
Jump to search
Staging Changes
Getting Existing Repo
git clone http://git.drupal.org/project/pathauto.git cd pathauto
git remote -v
origin http://git.drupal.org/project/pathauto.git (fetch) origin http://git.drupal.org/project/pathauto.git (push)
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
- Clone the http://git.drupal.org/project/pathauto.git
- Make sure you are on the 7.x-1.x
- Add a remote gituser@git.nobleprog.net:/gitrepo/pathauto, call it central
- Pull changes from central from 7.x-1.x branch
- Modify a file
- Push your changes to central