<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.freegeek.org/index.php?action=history&amp;feed=atom&amp;title=File_talk%3AWeb_workflow.png</id>
	<title>File talk:Web workflow.png - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.freegeek.org/index.php?action=history&amp;feed=atom&amp;title=File_talk%3AWeb_workflow.png"/>
	<link rel="alternate" type="text/html" href="http://wiki.freegeek.org/index.php?title=File_talk:Web_workflow.png&amp;action=history"/>
	<updated>2026-04-22T12:01:03Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>http://wiki.freegeek.org/index.php?title=File_talk:Web_workflow.png&amp;diff=58026&amp;oldid=prev</id>
		<title>Tonyc: dumping some git instructions</title>
		<link rel="alternate" type="text/html" href="http://wiki.freegeek.org/index.php?title=File_talk:Web_workflow.png&amp;diff=58026&amp;oldid=prev"/>
		<updated>2011-08-17T18:34:05Z</updated>

		<summary type="html">&lt;p&gt;dumping some git instructions&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Below is a dump of instructions on using git, originally written by Aaron amstutz[[User:Tonyc|Tonyc]]&lt;br /&gt;
&lt;br /&gt;
Setting up a remote repo, for Free Geek. Here’s my rundown on how to get this done.&lt;br /&gt;
&lt;br /&gt;
cd into the site’s directory. It’s my understanding that that the site isn’t currently under git, so you have to create a new git repo, containing the site’s files.&lt;br /&gt;
&lt;br /&gt;
git init&lt;br /&gt;
git add .&lt;br /&gt;
git commit -m “This is the first commit message on the new repo.”&lt;br /&gt;
&lt;br /&gt;
So now you’ve got the existing site and files under git. Cool! One quick thing to do, then we’ll head towards making a bare public repo. Its advantageous to have some files be ignored by git, like .htaccess, and wp-config.php. The way to do this is create a .gitignore file.&lt;br /&gt;
&lt;br /&gt;
vi .gitignore&lt;br /&gt;
(Then just add a list of the files you want to be ignored. Here’s the list I used for the dev site.)&lt;br /&gt;
&lt;br /&gt;
.htaccess&lt;br /&gt;
wp-config.php&lt;br /&gt;
wp-content/cache/*&lt;br /&gt;
&lt;br /&gt;
Alright, we’re ready to set up the public-accessible repo. I like to have a dir called Git, that way I can just keep all my public repos in the same spot, just a personal preference, but an organizational rule that a lot of people follow. So, cd up to the root of your web server folder, mine’s public_html.&lt;br /&gt;
&lt;br /&gt;
mkdir Git &amp;amp;&amp;amp; cd Git&lt;br /&gt;
mkdir yourproject.git &amp;amp;&amp;amp; cd yourproject.git&lt;br /&gt;
git —bare init&lt;br /&gt;
&lt;br /&gt;
It’ll tell you that it created a bare repository at the location, and now you’re ready to head back to the working repo to add the remote. cd into the site’s directory from your Git directory.&lt;br /&gt;
&lt;br /&gt;
git remote add public path-to-remote-repo/var/www/Git/yourproject.git&lt;br /&gt;
&lt;br /&gt;
If you look in the .git directory, there’ll be a file called config. This holds the repos’ knowledge of remote stuff, and some config stuff for it. Mine looks like:&lt;br /&gt;
&lt;br /&gt;
aaron@chasing-daylight.com [~/public_html/fgdev/.git]# cat config&lt;br /&gt;
[core]&lt;br /&gt;
repositoryformatversion = 0&lt;br /&gt;
filemode = true&lt;br /&gt;
bare = false&lt;br /&gt;
logallrefupdates = true&lt;br /&gt;
&lt;br /&gt;
[remote “public”]&lt;br /&gt;
url = ../Git/fg.git/&lt;br /&gt;
fetch = +refs/heads/:refs/remotes/origin/&lt;br /&gt;
&lt;br /&gt;
You see that the ‘public remote’ points to the repo in the Git dir. Cool. Now check yours. After the previous command, it should point to the public repo. If not, you can just edit the config file to point to it. You can also add any other remote repos you’d like in this file. This can be handy sometimes, but probably not something you need yet.&lt;br /&gt;
&lt;br /&gt;
So now we can push to the public repo:&lt;br /&gt;
&lt;br /&gt;
git push origin public&lt;br /&gt;
&lt;br /&gt;
It’ll output something like:&lt;br /&gt;
updating ‘refs/heads/public’&lt;br /&gt;
from 0000000000000000000000000000000000000000&lt;br /&gt;
to b379203bc187c2926f44a71eca3f901321ea42c6&lt;br /&gt;
Also local refs/remotes/origin/public&lt;br /&gt;
Generating pack…&lt;br /&gt;
Done counting 1374 objects.&lt;br /&gt;
Deltifying 1374 objects…&lt;br /&gt;
100% (1374/1374) done&lt;br /&gt;
Writing 1374 objects…&lt;br /&gt;
100% (1374/1374) done&lt;br /&gt;
Total 1374 (delta 89), reused 0 (delta 0)&lt;br /&gt;
refs/heads/public: 0000000000000000000000000000000000000000 → b379203bc187c2926f44a71eca3f901321ea42c6&lt;br /&gt;
&lt;br /&gt;
This takes the refs from our working dir, and pushes them to the repo we named public. We have to update the remote repo after this push, to make it ready to let people pull from it.&lt;br /&gt;
&lt;br /&gt;
cd ../Git/yourproject.git&lt;br /&gt;
git —bare update-server-info&lt;br /&gt;
mv hooks/post-update.sample hooks/post-update&lt;br /&gt;
&lt;br /&gt;
Great, now we have a working dir, and a bare repo for people to pull and push from/to. If they have ssh access to the server, they can:&lt;br /&gt;
&lt;br /&gt;
git clone ssh://myserver.com/var/Git/yourproject.git&lt;br /&gt;
&lt;br /&gt;
Do their work, make lots of well-documented commits, and then:&lt;br /&gt;
&lt;br /&gt;
git push ssh://yourserver.com/var/Git/yourproject.git&lt;br /&gt;
&lt;br /&gt;
If they don’t have ssh access, they can clone over http from the repo:&lt;br /&gt;
&lt;br /&gt;
git clone http://myserver.com/var/Git/yourproject.git&lt;br /&gt;
&lt;br /&gt;
Its slower, but works just fine. There is a way to set up pushing over http, via WebDAV, if that’s what you want (See setup-git-server-over-http in the git manual). Otherwise, they’ll have to send you a patch of their work, and you can apply it at your leisure.&lt;br /&gt;
&lt;br /&gt;
Cool! That should do it. Not that hard, right?&lt;br /&gt;
&lt;br /&gt;
I got all my info from the git manual (http://www.kernel.org/pub/software/scm/git/docs/user-manual.html), especially the Sharing development with others section (http://www.kernel.org/pub/software/scm/git/docs/user-manual.html#sharing-development) and from Toolman Tim’s great article (http://toolmantim.com/articles/setting_up_a_new_remote_git_repository) on setting up git repos.&lt;/div&gt;</summary>
		<author><name>Tonyc</name></author>
	</entry>
</feed>