<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://kb.owrench.com/index.php?action=history&amp;feed=atom&amp;title=Git_iterate_live</id>
	<title>Git iterate live - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://kb.owrench.com/index.php?action=history&amp;feed=atom&amp;title=Git_iterate_live"/>
	<link rel="alternate" type="text/html" href="http://kb.owrench.com/index.php?title=Git_iterate_live&amp;action=history"/>
	<updated>2026-05-04T04:23:38Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>http://kb.owrench.com/index.php?title=Git_iterate_live&amp;diff=133&amp;oldid=prev</id>
		<title>imported&gt;Midhungirish at 11:20, 15 November 2017</title>
		<link rel="alternate" type="text/html" href="http://kb.owrench.com/index.php?title=Git_iterate_live&amp;diff=133&amp;oldid=prev"/>
		<updated>2017-11-15T11:20:12Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The following commands are executed in Iterate staging server for setting up the application in Git. &amp;lt;br&amp;gt;&lt;br /&gt;
--------------------------------------------------------------------------------------------------------- &amp;lt;br&amp;gt;&lt;br /&gt;
1. Installed git in the server. &amp;lt;br&amp;gt;&lt;br /&gt;
    $apt-get update &amp;lt;br&amp;gt;&lt;br /&gt;
    $apt-get install git &amp;lt;br&amp;gt;&lt;br /&gt;
2. Switched to the iterftp user and created a new ssh key pair. &amp;lt;br&amp;gt;&lt;br /&gt;
    $su iterftp &amp;lt;br&amp;gt;&lt;br /&gt;
    $ssh-keygen -t rsa &amp;lt;br&amp;gt;&lt;br /&gt;
    (and finish the wizard with default values) &amp;lt;br&amp;gt;&lt;br /&gt;
    Copy the contents of id_rsa.pub to the ssh keys section in github. &amp;lt;br&amp;gt;&lt;br /&gt;
3. Cloned the repo into a new folder in the server. &amp;lt;br&amp;gt;&lt;br /&gt;
    $cd /var/www/docroot/ &amp;lt;br&amp;gt;&lt;br /&gt;
    $git init &amp;lt;br&amp;gt;&lt;br /&gt;
    $git remote add origin git@github.com:IterateAI/IterateWeb.git &amp;lt;br&amp;gt;&lt;br /&gt;
    $git remote set-url origin git@github.com:IterateAI/IterateWeb.git &amp;lt;br&amp;gt;&lt;br /&gt;
    $git clone git@github.com:IterateAI/IterateWeb.git &amp;lt;br&amp;gt;&lt;br /&gt;
4. Created the &amp;quot;tmp&amp;quot; folder and its subfolders within the &amp;quot;app&amp;quot; folder. &amp;lt;br&amp;gt;&lt;br /&gt;
5. Copied the database.php file from current installation to the new one. &amp;lt;br&amp;gt;&lt;br /&gt;
6. Copied the &amp;quot;webroot/config_constant.php&amp;quot; file from the current installation to new one. &amp;lt;br&amp;gt;&lt;br /&gt;
7. Copied the .htaccess files from the document root, &amp;quot;app&amp;quot; folder and &amp;quot;webroot&amp;quot; folder into the corresponding folders in the new setup. &amp;lt;br&amp;gt;&lt;br /&gt;
8. Edited the apache virtualhost and changed the document root to point to the new installation. &amp;lt;br&amp;gt;&lt;br /&gt;
9. Restarted apache. &amp;lt;br&amp;gt;&lt;br /&gt;
-------------------------  &amp;lt;br&amp;gt;&lt;br /&gt;
Now, for pulling the latest changes to the server, follow the steps below. &amp;lt;br&amp;gt;&lt;br /&gt;
ssh root@216.70.112.197 &amp;lt;br&amp;gt;&lt;br /&gt;
Provide password, login and do the following commands. &amp;lt;br&amp;gt;&lt;br /&gt;
su iterftp &amp;lt;br&amp;gt;&lt;br /&gt;
cd /var/www/docroot/IterateWeb/ &amp;lt;br&amp;gt;&lt;br /&gt;
git pull &amp;lt;br&amp;gt;&lt;br /&gt;
That's it. All latest updates should be available in server now. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
------------------------------------------------------------------------------------------------------------------------------------------------ &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following steps are performed in the production server. &amp;lt;br&amp;gt;&lt;br /&gt;
1. su iteruser  &amp;lt;br&amp;gt;&lt;br /&gt;
Note that the home directory of this user is : /var/www/html/  &amp;lt;br&amp;gt;&lt;br /&gt;
2. Now create a ssh key for the user.  &amp;lt;br&amp;gt;&lt;br /&gt;
 ssh-keygen -t rsa &amp;lt;br&amp;gt;&lt;br /&gt;
(Do not provide any passphrase) &amp;lt;br&amp;gt;&lt;br /&gt;
The key files should be created in /var/www/html/ by default. &amp;lt;br&amp;gt;&lt;br /&gt;
3. Now clone the repo to &amp;quot;/var/www&amp;quot;, so that we can rename it to &amp;quot;html&amp;quot; later.&lt;br /&gt;
 git init &amp;lt;br&amp;gt;&lt;br /&gt;
 git remote add origin git@github.com:IterateAI/IterateWeb.git &amp;lt;br&amp;gt;&lt;br /&gt;
 git remote set-url origin git@github.com:IterateAI/IterateWeb.git &amp;lt;br&amp;gt;&lt;br /&gt;
 git clone &amp;lt;br&amp;gt;&lt;br /&gt;
4. There will be a folder called &amp;quot;IterateWeb&amp;quot; in www folder now. Rename this folder to &amp;quot;html&amp;quot; (Before that, rename the current html to something else) &amp;lt;br&amp;gt;&lt;br /&gt;
 mv html html-bak &amp;lt;br&amp;gt;&lt;br /&gt;
 mv IterateWeb html &amp;lt;br&amp;gt;&lt;br /&gt;
5. Copy the ssh key folder to current &amp;quot;html&amp;quot; folder. &amp;lt;br&amp;gt;&lt;br /&gt;
 cd /var/www/html-bak/ &amp;lt;br&amp;gt;&lt;br /&gt;
 cp -r .ssh /var/www/html/ &amp;lt;br&amp;gt;&lt;br /&gt;
6. Created the &amp;quot;tmp&amp;quot; folder and its subfolders within the &amp;quot;app&amp;quot; folder. &amp;lt;br&amp;gt;&lt;br /&gt;
7. Copied the database.php file from current installation to the new one. &amp;lt;br&amp;gt;&lt;br /&gt;
8. Copied the &amp;quot;webroot/config_constant.php&amp;quot; file from the current installation to new one. &amp;lt;br&amp;gt;&lt;br /&gt;
9. Copied the .htaccess files from the document root, &amp;quot;app&amp;quot; folder and &amp;quot;webroot&amp;quot; folder into the corresponding folders in the new setup. &amp;lt;br&amp;gt;&lt;br /&gt;
----------------------------- &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now for pulling the latest changes to the server, follow these steps: &amp;lt;br&amp;gt;&lt;br /&gt;
1. su iteruser &amp;lt;br&amp;gt;&lt;br /&gt;
2. cd /var/www/html/ &amp;lt;br&amp;gt;&lt;br /&gt;
3. git pull &amp;lt;br&amp;gt;&lt;br /&gt;
That's it. All changes should be up to date now. &amp;lt;br&amp;gt;&lt;br /&gt;
---------------------------------------------------------------------------------------------------------------------- &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there are conflicts when pulling in the server, we can use the following commands to resolve (depending on the exact conflict error) Best to check git documentation before executing. &amp;lt;br&amp;gt;&lt;br /&gt;
 git fetch &amp;lt;br&amp;gt;&lt;br /&gt;
 git reset --hard origin/master &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:it-support]]&lt;/div&gt;</summary>
		<author><name>imported&gt;Midhungirish</name></author>
		
	</entry>
</feed>