14 — Empty repository and starting with git
If you created the repository without ticking Initialize repository, you land on an empty repository and a quick guide. This chapter is that screen in full.
Your addresses
At the top of an empty repository page there are two addresses:
HTTPS https://forge.kabaforce.com/owner/project.git
SSH [email protected]:owner/project.git
HTTPS works with a token, SSH with a key (chapter 10). Both reach the same repository, and you can switch later.
A brand new repository
If there is no git repository on your machine yet:
mkdir project && cd project
git init
git switch -c main
echo "# project" > readme.md
git add readme.md
git commit -m "first commit"
git remote add origin https://forge.kabaforce.com/owner/project.git
git push -u origin main
-u is only needed for the first push; after that git push is enough.
Pushing an existing local repository
If your folder already has a .git, do not start over:
cd existing-project
git remote add origin https://forge.kabaforce.com/owner/project.git
git push -u origin main
If your branch is called master, either push it as it is or rename it first:
git branch -m master main
Changing the remote address
After a move, or when switching between HTTPS and SSH:
git remote -v # where does it point now
git remote set-url origin [email protected]:owner/project.git
Why an initialized repository is easier
Ticking Initialize repository creates the first commit with a README.md, so you can clone and start working immediately:
git clone https://forge.kabaforce.com/owner/project.git
The creation screen also offers a .gitignore template and a licence — both can be added by hand later, but choosing them upfront saves a step.
When the first push fails
| Symptom | Cause |
|---|---|
Authentication failed | You typed a password; HTTPS needs a token (chapter 10) |
Permission denied (publickey) | Your SSH key is not on the account |
src refspec main does not match any | No commit yet — run git commit first |
failed to push some refs | The remote has commits you do not — git pull, then retry |