Step-by-step Git Workflow
Here are the step-by-step instructions to initialize your repository, set up your development workspace, and sync it directly to your local Forgejo server.
Step 1: Create the Repository on Forgejo. Open your web browser and log into your local Forgejo dashboard.
- Click the + icon in the top-right corner and select New Repository.
- Set the Repository Name to monitor-act.
- Leave Initialize Repository, .gitignore, and License unchecked (since we already have our own code files ready on the dev machine).
- Click the Create Repository button.
- Copy the repository URL provided on the next screen (e.g., http://your-server-ip:3000/username/monitor-act.git).
Step 2: Initialize Git on Your Development MachineOpen your terminal inside your project folder (monitor-act) on your workstation and run the following commands to link your files:bash# Initialize a brand new local Git workspace tracker git init -b main
Link your local folder to your new hidden Forgejo server destination
git remote add origin http://your-server-ip:3000/username/monitor-act.gitStage all of your clean Nim source code files, README.md, and .gitignore
git add .Lock files cleanly into your first local baseline checkpoint commit
git commit -m "Initial commit: Pure Nim cross platform file monitor source assets"- Step 3: Push Code to the Server
Push your main code asset timeline directly up to the remote master origin server
git push -u origin main(If prompted, type your standard Forgejo dashboard user account credentials to authenticate the synchronization window).
- Step 4: Create and Activate the development Branch
Now, establish your isolated staging environment branch so you can work safely without touching your production code layout. Create and immediately switch onto a fresh local ‘development’ branch
git checkout -b developmentPush and track your new branch up onto the Forgejo server
git push -u origin developmentCurrent Workspace State VerificationTo verify your active workspace path settings are correct, run:
git branch -vYour terminal will highlight your active branch with an asterisk (* development). You can now safely make, test, and commit your code adjustments here without breaking your main deployment version line.