Skip to content
Tom Ash edited this page Feb 1, 2018 · 3 revisions

There are plenty of good guides to using git out there. Here are some examples of things you'll have to do when working on the EA Forum:

Getting your own local copy

Run this in your command line (using the https URL often works when SSH doesn't)

git clone https://github.com/tog22/eaforum.git

This'll get you the master branch from which you can create your own development branch (see below). But if you like you can also clone all remote branches:

git branch -a | grep -v HEAD | perl -ne 'chomp($_); s|^\*?\s*||; if (m|(.+)/(.+)| && not $d{$2}) {print qq(git branch --track $2 $1/$2\n)} else {$d{$_}=1}' | csh -xfs

(from http://stackoverflow.com/questions/67699/clone-all-remote-branches-with-git - optionally, see that)

Creating and switching between branches

Create your own new branch to work on the forum code in: git branch branchname (or git checkout -b branchname )

Switch to it: git checkout branchname

List branches: git branch

Decent practice (I think, made up by me): make your changes in a ‘testing’ branch, then do only the ones you want to push in a ‘changes-to-push’ branch

Updating your copy to pull in all changes in the remote copy

cd your-local-copy git checkout master # goes to main production branch git pull origin master # make sure you have latest changes git checkout # move back to your working branch. ur working branch will inherit the changes in origin/master that you just pulled into your local master branch git merge origin/master -m 'Backmerged master' # Merge master changes into your working branch

Merging in changes from upstream repo (trike)

https://help.github.com/articles/merging-an-upstream-repository-into-your-fork/

Eg: git pull https://github.com/tricycle/eaforum.git master

Then if applicable merge these changes into your other branches thus: git checkout # move back to your working branch. ur working branch will inherit the changes in origin/master that you just pulled into your local master branch git merge origin/master -m 'Backmerged master' # Merge master changes into your working branch