User Tools

Site Tools


how_to_adapt_to_git

How To Adapt To Git

If you started modifying your platform's core files and don't want to use vQmod for soft modifying it. Then you probably think upgrading the platform is hundreds of hours of work. That does not need to be the case.

Adapt your current platform to Git for easily pulling future updates. In this example we are using BitBucket for the private repository. Here is what to do:

1. Sign in to BitBucket and create a new private Git repository.

2. Substitute your LiteCart project folder with a new empty folder:

3. Use your Git Bash to initialize your Git project and configure it for repositories. (We are assuming you have Git installed on your computer e.g. https://tortoisegit.org/download/)

# Navigate to the project folder
cd c:\path\to\myproject\

# Make this directory a Git project
git init

# Add your Bitbucket repository as "origin"
git remote add origin https://yourusername@bitbucket.org/yourusername/yourrepo.git

# Add LiteCart's repository as "litecart"
git remote add litecart https://github.com/litecart/litecart.git

# Pull everything from LiteCart's repository
git pull litecart

# Revert back to a certain version number (stated by it's tagname) e.g. 2.1.6
git reset --hard 2.1.6

# Push all your content to your new repository's main branch named master
git push -u origin master

3. Copy all your files from your previous project folder to the new project folder. Overwrite any existing files in your new repository. You can use the command line interface to view all your changes:

# Show all changes
git status

4. Commit your modified files to the project.

# Commit all changes
git commit -m "My big initial commit"

# Push your commit(s) to your repository named origin
git push -u origin master

5. Now begins the fun. Pull all updates from Github.

# Pull all updates from the Github repository we called litecart
git pull litecart

6. Solve any merge conflicts. (This guide will not teach you how to solve conflicts. But we recommend using TortoiseGit Resolve)

7. Use your browser to navigate to the installation folder and run the upgrade script. This will perform all changes necessary to update files and database.

 http://localhost/install/upgrade.php

8. After the upgrade, make sure your platform is running fine. Use your web browser to access it:

 http://localhost/

9. Finally commit all changes and push them to your repository:

# Commit all changes
git commit -m "Initial commit"

# Push commit to repository
git push -u origin master

11. All done! You should now be running the latest update of LiteCart merged with all your modifications.

Now you can use Git to commit all your new features and updates. Next time you want to pull an update, go back to step 5.

Sourcetree is a great GUI tool for playing with your Git projects. It's awesome, just like LiteCart! ;)

how_to_adapt_to_git.txt · Last modified: 2019/11/22 02:21 by admin