Post

Git Wiki

Git Wiki

Bulifier manages files in SQLite using the Room library. When executing Git commands, it synchronizes the database with the local file system where Git resides.

The Git client is a fork of JGit, specifically adapted for Android to work with Bulifier. You can see it here.

Git Roots Settings

Bulifier uses a special file called git_roots.settings to track the top-level directories that are included in Git operations. Here’s how it works:

  1. Root Folders: The user can choose which folders to add as Git roots (via the Folder Settings UI).
  2. Smart Management: Bulifier ensures there are no duplicates or nested directories among these root folders. In other words, you don’t need to worry about adding overlapping folders—Bulifier handles it automatically.
  3. Why It’s Important:
    • Deletions: If no Git roots are set up, Bulifier won’t know which files are officially tracked. As a result, deletions during commits won’t be handled properly.
    • Renames/Move Operations: When files are moved or renamed, if you haven’t set up the roots correctly, those files may be duplicated during commits because Bulifier can’t tell the old and new paths are the same file.

If you notice unexpected file duplication or that deletions aren’t working, check your git_roots.settings file and make sure your root folders are properly configured.

1
2
3
4
5
6
7
{
// Example format for illustration only
"git_roots": [
"/path/to/first/root",
"/path/to/second/root"
]
}

Setting up these roots ensures that Bulifier can accurately track and update all files while avoiding conflicts or duplication.

Git Actions

Below are all the Git actions supported in Bulifier. For each action, you’ll see the equivalent command-line Git command and the specific steps Bulifier takes.

Clone

Clone the remote repository locally and load the content into the database.

Equivalent Git command:

1
git clone <url>

Steps:

  1. Delete all project files.
  2. Execute git clone.
  3. Export the database to the project folder, overriding any existing files.
  4. Delete all files from the database for the selected project.
  5. Load project files into the database.
  6. Load schemas.
  7. Create git_roots.settings file if it doesn’t exist.

Revert

Clean up and revert to the provided commit; you can select it via the UI.

Equivalent Git commands:

1
2
3
git reset --hard
git clean -dfx
git revert <commit hash>

Steps:

  1. Reset Git to the latest local commit, discarding all uncommitted changes.
  2. Delete all files from the database for the selected project.
  3. Load project files into the database.

Checkout

Check out a new or existing branch. When creating a new branch, it branches off from the current one. If there are uncommitted changes, this action is blocked.

Equivalent Git commands:

1
2
3
4
git fetch
git checkout <branch-name>
or
git checkout -b <new-branch-name>

Steps:

  1. Delete all git_roots.settings files.
  2. Export the database to the project folder, overriding any existing files.
  3. If there are uncommitted changes, abort.
  4. Fetch and check out the branch.
  5. Delete all files from the database for the selected project.
  6. Load project files into the database.

Pull

Fetch and merge changes from the remote repository.

Equivalent Git command:

1
git pull

Steps:

  1. Delete all git_roots.settings files.
  2. Export the database to the project folder, overriding any existing files.
  3. Execute git pull.
  4. Delete all files from the database for the selected project.
  5. Load project files into the database.

Push

Send local commits to the remote repository.

Equivalent Git command:

1
git push

Steps:

  1. Delete all git_roots.settings files.
  2. Export the database to the project folder, overriding any existing files.
  3. If there are uncommitted changes, abort.
  4. Execute git push.

Commit

Create a new commit in the local repository.

Equivalent Git command:

1
git commit -am "<message>"

Steps:

  1. Delete all git_roots.settings files.
  2. Export the database to the project folder, overriding any existing files.
  3. Execute git commit.

Hard Reset & Clean

Revert to the latest local commit, discarding any uncommitted changes.

Equivalent Git commands:

1
2
git reset --hard
git clean -dfx

Steps:

  1. Reset Git to the latest local commit, deleting all uncommitted changes.
  2. Delete all files from the database for the selected project.
  3. Load project files into the database.

© Gazman Dev LLC. Some rights reserved.