forum.webdiplomacy.net

webDip dev coordination forum / public access todo list
It is currently Sat Nov 18, 2017 2:20 am

All times are UTC




Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: Git repo
PostPosted: Sun Sep 04, 2011 4:45 am 
Offline
Site Admin

Joined: Sat Jun 28, 2008 6:24 am
Posts: 892
This is the git repo for webDiplomacy:

git@github.com:kestasjk/webDiplomacy.git


See http://help.github.com/win-set-up-git/ to get started with git (it's a bit of hassle on windows, but once you're done it's straightforward)

Once everything is set up you'll be able to have your own local copy which you can sync with
Code:
git fetch upstream && git merge upstream/master

And you'll be able to make your repo available via a github address as well, which others can sync to / merge changes from.


The only thing to watch out for is that you don't sync your config.php file, cached data, or error / order logs. There is a .gtignore file you can set up to ignore those (but this shouldn't matter unless you're publishing your own repo)


Top
 Profile  
 
 Post subject: Re: Git repo
PostPosted: Sun Sep 04, 2011 6:14 am 
Offline
Site Admin

Joined: Sat Jun 28, 2008 6:24 am
Posts: 892
Example cloned repo setup: (Assumes you have a github account ready)
Code:
[www@95 ~]$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/www/.ssh/id_rsa):
Created directory '/home/www/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/www/.ssh/id_rsa.
Your public key has been saved in /home/www/.ssh/id_rsa.pub.
The key fingerprint is:
28:dd:34:0d:f4:3f:bb:3f:72:29:ce:6a:ea:05:97:da www@95.211.128.12
The key's randomart image is:
+--[ RSA 2048]----+
|       .o        |
|         +       |
|        o o      |
|     . + . o     |
|    . o S o o    |
|     .   =   o   |
|        . E .  . |
|         ...o.+  |
|       .oo.o+=.. |
+-----------------+
[www@95 ~]$ cat .ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDbCxrPfDvrhTvRTeoMPZ2ZH0TVZ5pcnK
q8nSFuhkeJVAOJL2ivV8QFjkole3UozNQmUdNannRbILrkVNSbJl8SDpYYxJJtQkpRSWaW2t
24nFvNhD88tHmPI8kz81zOvHnjKnHaeJDytYjgEx2Lf9t3odCrJtHKrvK49T72Ixzp7BkhOT85
Vq7ltaBTNnHnQtdVvbpasnnmVqdCsFBkmhHze+hdThf1EDFozjFTl1tlCdflZhg4Gmpvr0prqR
nQghkli+7Dg0g+aIR37HtCKJelR5XKu+wFPTz3ATWKm4E7VwbmoBuuqcT19peEZkbNL58E
unmWtzu6xi99qzBWbyNV www@95.211.128.12

Paste this public key into the ssh keys section of your github account settings, so that github knows what account you're logging in as.

Code:
[www@95 ~]$ git clone git@github.com:kestasjk/webDiplomacy.git
Cloning into webDiplomacy...
The authenticity of host 'github.com (207.97.227.239)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com' (RSA) to the list of known hosts.
remote: Counting objects: 620, done.
remote: Compressing objects: 100% (495/495), done.
remote: Total 620 (delta 109), reused 616 (delta 105)
Receiving objects: 100% (620/620), 2.97 MiB | 1.15 MiB/s, done.
Resolving deltas: 100% (109/109), done.
[www@95 ~]$ ls
webDiplomacy
[www@95 ~]$ ls webDiplomacy/
AGPL.txt                forum.php               logon.php
README                  gamecreate.php          map
README.txt              gamelistings.php        map.php
admin                   gamemaster              missing.html
admincp.php             gamemaster.php          objects
ajax.php                gamepanel               pager
board                   gamesearch              points.php
board.php               global                  profile.php
cache.php               halloffame.php          register
config.sample.php       header.php              register.php
contrib                 help.php                roadmap.php
credits.php             images                  robots.txt
css                     index.php               rules.php
datc                    install                 sitemap.xml
datc.php                internal_error.html     translating.php
developers.php          intro.php               usercp.php
doc                     invite.php              variants
facebook                javascript              variants.php
faq.php                 lib                     xd_receiver.htm
favicon.ico             locales

Now just copy in a valid config.php which has your customized set-up, and you've got a live, git-synced webDip.

From here on just use
Code:
git fetch upstream && git merge upstream/master
to stay in sync with the official webDiplomacy repo. If there are conflicts with changes you have made you'll be warned and prompted to resolve them

The official repo includes a .gitignore file which filters out config files, cached data, generated maps, etc, so once you've got a clone of webDip you can work on it yourself and create your own repo.


Patches can also be sent into the official repo using pull requests (basically sending a patch and requesting that it gets merged), but I haven't looked at this much yet.


Top
 Profile  
 
 Post subject: Re: Git repo
PostPosted: Sun Sep 04, 2011 10:24 am 
Offline

Joined: Wed Jul 29, 2009 10:22 am
Posts: 841
Works.
I can get the files from git without any problems.
Now I'll test how to keep the data on my local test server in sync with my live install..

Oliver


Top
 Profile  
 
 Post subject: Re: Git repo
PostPosted: Sun Sep 04, 2011 10:37 am 
Offline

Joined: Wed Jul 29, 2009 10:22 am
Posts: 841
A question.
Your css dir is names "css", not "css3" as from the last tar.
And the javascript-dir is called javascript, not javascript7...

Did you change the names, or is this an error.

Oli


Top
 Profile  
 
 Post subject: Re: Git repo
PostPosted: Sun Sep 04, 2011 11:43 am 
Offline
Site Admin

Joined: Sat Jun 28, 2008 6:24 am
Posts: 892
Sleepcap wrote:
A question.
Your css dir is names "css", not "css3" as from the last tar.
And the javascript-dir is called javascript, not javascript7...

Did you change the names, or is this an error.

Oli

That was intentional, I figured it'd be good to get those names right from the start rather than later have to rename everything and make it harder to trace the history of various files


Top
 Profile  
 
 Post subject: Re: Git repo
PostPosted: Sun Sep 04, 2011 11:44 am 
Offline
Site Admin

Joined: Sat Jun 28, 2008 6:24 am
Posts: 892
Also I uploaded a bad half-completed model.js, and the variant cache directories were missing (though I may make it so they are created on the fly, rather than they have to exist beforehand)


Top
 Profile  
 
 Post subject: Re: Git repo
PostPosted: Sun Sep 04, 2011 6:05 pm 
Offline

Joined: Wed Jul 29, 2009 10:22 am
Posts: 841
First problem:
If I choose pull to update the files I get:
Code:
Updating c155959..0ceb724
Aborting
error: Your local changes to the following files would be overwritten by merge:
   .gitignore
Please, commit your changes or stash them before you can merge.
Oliver


Top
 Profile  
 
 Post subject: Re: Git repo
PostPosted: Sun Sep 04, 2011 11:21 pm 
Offline
Site Admin

Joined: Sat Jun 28, 2008 6:24 am
Posts: 892
For me to push into my repo I do:
Code:
$ #(Assumes you have already set up git and linked to a remote repo as per http://help.github.com/win-set-up-git/ and http://help.github.com/create-a-repo/)
$ git add . # <-- find any new files
$ git commit -m 'feature xyz added' # <-- takes a commit snapshot
$ git push origin master # <-- uploads the current state


A pull is where you don't own the repo, but you request someone else pull your patch into the repo (because you can't push it in).

That's an exciting function because it'll make it easy for you to offer up changes to be easily incorporated into the main branch, but I would leave that kind of functionality for later (especially since it'll be easier to keep your own changes without incorporating them anyway)


Bear in mind if the aim is just to maintain a fork by yourself you don't need to worry about pushing stuff back into a repo too much, since you only need to maintain your own repo if you want to let others access your fork


Top
 Profile  
 
 Post subject: Re: Git repo
PostPosted: Sun Sep 04, 2011 11:23 pm 
Offline
Site Admin

Joined: Sat Jun 28, 2008 6:24 am
Posts: 892
By the way Im sure you already have but for the love of god take a backup of your code before doing all this


Top
 Profile  
 
 Post subject: Re: Git repo
PostPosted: Wed Sep 07, 2011 10:15 am 
Offline

Joined: Thu Jan 14, 2010 7:48 pm
Posts: 87
Is this intended to be instead of the latest code available, or we could try to put there some other minor things?

Like for example, take some hard coded ingame values, and "un-hard code" them in order to have a translation in the future?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2, 3  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group