ugit

Overview

Initializing a Local Repository

What is Initialization?

Initializing a repository creates a new .git directory in your project folder. This enables version control for your local files, allowing you to track changes, create commits, and eventually sync with a remote repository.


When to Initialize

Initialize a new repository when:


How to Initialize a Repository

Step 1: Open the Init Dialog

  1. Click File in the menu bar
  2. Select Init New Repository…

Step 2: Select Folder

  1. A folder picker dialog will appear
  2. Navigate to the folder you want to initialize as a Git repository
  3. Click Select Folder (or Open)

The selected folder will be initialized as a Git repository.


After Initialization

After initializing, you’ll see:


What Happens During Initialization

When you initialize a repository:

  1. A .git folder is created in your project directory
  2. An initial main branch is created
  3. No commits exist yet (the repository starts empty)
  4. All existing files in the folder appear as Unstaged Files

Example Workflow

1. Initialize the Repository

File → Init New Repository... → Select your project folder

2. Stage Your Files

3. Create Your First Commit

4. (Optional) Add a Remote

If you want to sync with GitHub, GitLab, or another remote:

  1. Go to Remotes section
  2. Click Add Remote
  3. Enter the remote URL (e.g., https://github.com/yourname/yourrepo.git)
  4. Push your commits with Push

Troubleshooting

“Not a git repository”

If you see this error, the folder hasn’t been properly initialized. Try re-initializing:

  1. Close the repository in ugit
  2. Use File → Init New Repository… and select the folder again

Files Not Showing

Make sure your files are in the root folder of the repository, not in subfolders (unless you’re intentionally organizing that way).

Already a Git Repository

If the folder already contains a .git directory, ugit will open it as an existing repository rather than re-initializing.