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:
- Root Folders: The user can choose which folders to add as Git roots (via the Folder Settings UI).
- 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.
- 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:
- Delete all project files.
- Execute
git clone
. - Export the database to the project folder, overriding any existing files.
- Delete all files from the database for the selected project.
- Load project files into the database.
- Load schemas.
- 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:
- Reset Git to the latest local commit, discarding all uncommitted changes.
- Delete all files from the database for the selected project.
- 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:
- Delete all
git_roots.settings
files. - Export the database to the project folder, overriding any existing files.
- If there are uncommitted changes, abort.
- Fetch and check out the branch.
- Delete all files from the database for the selected project.
- Load project files into the database.
Pull
Fetch and merge changes from the remote repository.
Equivalent Git command:
1
git pull
Steps:
- Delete all
git_roots.settings
files. - Export the database to the project folder, overriding any existing files.
- Execute
git pull
. - Delete all files from the database for the selected project.
- Load project files into the database.
Push
Send local commits to the remote repository.
Equivalent Git command:
1
git push
Steps:
- Delete all
git_roots.settings
files. - Export the database to the project folder, overriding any existing files.
- If there are uncommitted changes, abort.
- Execute
git push
.
Commit
Create a new commit in the local repository.
Equivalent Git command:
1
git commit -am "<message>"
Steps:
- Delete all
git_roots.settings
files. - Export the database to the project folder, overriding any existing files.
- 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:
- Reset Git to the latest local commit, deleting all uncommitted changes.
- Delete all files from the database for the selected project.
- Load project files into the database.