{"id":6798,"date":"2026-11-05T01:27:30","date_gmt":"2026-11-05T01:27:30","guid":{"rendered":"https:\/\/www.voodoo.business\/blog\/?p=6798"},"modified":"2026-11-06T09:00:55","modified_gmt":"2026-11-06T09:00:55","slug":"using-your-self-hosted-gitea-server","status":"publish","type":"post","link":"https:\/\/www.voodoo.business\/blog\/2026\/11\/05\/using-your-self-hosted-gitea-server\/","title":{"rendered":"Using your Self-Hosted gitea server"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">How to Use Your Self-Hosted Gitea Server: A Beginner&#8217;s Guide for Developers<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">You have a self-hosted Git server running Gitea, and your team has invited you to collaborate on a project. Now what?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you have never used Git before, the terminology can be intimidating: repositories, commits, branches, remotes, SSH keys, pushes, pulls&#8230;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Don&#8217;t worry. This guide will walk you through everything you need to get started, from configuring your computer to collaborating with other developers.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You don&#8217;t need administrator access to the Gitea server, and you don&#8217;t need to know how it was installed. You just need a Gitea account, access to a repository, and Git installed on your computer.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. What You Need Before Getting Started<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Ask your team leader or Gitea administrator for the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Gitea address:<\/strong> The URL of your team&#8217;s Git server, for example <code>https:\/\/git.example.com<\/code>.<\/li>\n\n\n\n<li><strong>Your account:<\/strong> Your Gitea username and login credentials.<\/li>\n\n\n\n<li><strong>Repository access:<\/strong> The repository you will be working on, and confirmation that you have permission to access it.<\/li>\n\n\n\n<li><strong>SSH clone address:<\/strong> The SSH address of the repository, normally displayed on its Gitea page.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">You might also need the SSH port if your administrator has configured SSH to use something other than the standard port 22.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you don&#8217;t have a Gitea account yet, ask your administrator to create one or invite you.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2. Create an SSH Key<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">SSH keys allow your computer to authenticate with Gitea without repeatedly asking for your account password.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The process involves two files:<\/p>\n\n\n\n<!--more-->\n\n\n\n<ul class=\"wp-block-list\">\n<li>A <strong>private key<\/strong>, which stays on your computer and must never be shared.<\/li>\n\n\n\n<li>A <strong>public key<\/strong>, which you upload to your Gitea account.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Check whether you already have an SSH key<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">On Linux or macOS, open a terminal. On Windows, open PowerShell or Git Bash.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ls -la ~\/.ssh<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Look for files such as:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>id_ed25519\nid_ed25519.pub<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If you already have an Ed25519 key that you intend to use, you can skip key generation.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you don&#8217;t, create one:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh-keygen -t ed25519 -C \"your-email@example.com\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">When asked where to save the key, press Enter to accept the default location.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can also protect your private key with a passphrase. This is recommended, especially on laptops.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You should now have two files:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>~\/.ssh\/id_ed25519\n~\/.ssh\/id_ed25519.pub<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Never share<\/strong> <code><strong>id_ed25519<\/strong><\/code><strong>.<\/strong> That is your private key.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Add your public key to Gitea<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Display your public key:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cat ~\/.ssh\/id_ed25519.pub<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Copy the entire output.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now open your Gitea website:<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>Sign in to your account.<\/li>\n\n\n\n<li>Click your profile picture and open <strong>Settings<\/strong>.<\/li>\n\n\n\n<li>Navigate to <strong>SSH \/ GPG Keys<\/strong>.<\/li>\n\n\n\n<li>Click <strong>Add Key<\/strong>.<\/li>\n\n\n\n<li>Give the key a descriptive name, such as <code>My Desktop<\/code> or <code>Work Laptop<\/code>.<\/li>\n\n\n\n<li>Paste your public key and save it.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">That&#8217;s it! Your computer is now registered with Gitea.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you use multiple computers, generate and register a separate SSH key for each one. Do not copy your private key between machines.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3. Install Git on Your Computer<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Git is the version-control software that manages your projects. Gitea is the server that hosts your Git repositories.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You need Git installed locally, even though your team already has a Git server.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Debian and Ubuntu<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update\nsudo apt install git<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Windows<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Download and install Git from:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/git-scm.com\/downloads\">https:\/\/git-scm.com\/downloads<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The installation includes Git Bash, which provides a convenient terminal for running Git commands.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">macOS<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If you use Homebrew:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>brew install git<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can verify that Git is installed by running:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git --version<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">4. Configure Your Git Identity<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before creating commits, tell Git who you are.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git config --global user.name \"Your Name\"\ngit config --global user.email \"your-email@example.com\"\ngit config --global init.defaultBranch main\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Use the name and email address you want associated with your contributions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">These settings identify the author of your commits. They are separate from your Gitea username and password.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">By default, the main branch is called master, above, we change the default to main, but this is just my preference<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To check your configuration:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git config --global --list<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You only need to do this once on each computer.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">5. Clone Your Team&#8217;s Repository<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A repository is a project managed by Git. It contains the project&#8217;s files and its version history.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In most team environments, you will be given access to an existing repository.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Open the repository in Gitea. You should see a <strong>Clone<\/strong> button, which provides HTTPS and SSH addresses.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For this guide, we will use SSH.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">An SSH address typically looks like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gitea@git.example.com:team\/my-project.git<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The actual address depends on your server configuration. Always copy the address displayed by your Gitea installation rather than constructing one yourself.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Open a terminal in the directory where you want your projects stored, then run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git clone gitea@git.example.com:team\/my-project.git<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Git will download the repository and create a directory for it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Enter that directory:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd my-project<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Congratulations! You now have a local copy of your team&#8217;s project.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">What does cloning actually do?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Git does more than download the latest files.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It downloads the repository&#8217;s commit history as well. This means you can inspect previous versions, create branches, make commits, and work locally without needing a permanent internet connection.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The Gitea server is the shared repository where team members exchange their work.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">6. Understand the Basic Git Workflow<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before making changes, there are a few concepts worth understanding.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Working directory:<\/strong> The files you are currently editing.<\/li>\n\n\n\n<li><strong>Staging area:<\/strong> The changes you have selected for your next commit.<\/li>\n\n\n\n<li><strong>Commit:<\/strong> A recorded snapshot of your project changes.<\/li>\n\n\n\n<li><strong>Remote:<\/strong> A repository hosted somewhere else, such as your team&#8217;s Gitea server.<\/li>\n\n\n\n<li><strong>Push:<\/strong> Sending your local commits to the remote repository.<\/li>\n\n\n\n<li><strong>Pull:<\/strong> Retrieving remote changes and integrating them into your local branch.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The basic workflow looks like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Edit files\n    |\n    v\ngit status\n    |\n    v\ngit add\n    |\n    v\ngit commit\n    |\n    v\ngit push<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s put that into practice.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">7. Make Your First Change<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Open one of the project files and make a small modification.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, edit <code>README.md<\/code> and add a line describing your contribution.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git status<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Git will show you which files have changed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To see exactly what you modified:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git diff<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">When you are satisfied with your changes, stage the file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git add README.md<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If you want to stage all changes in the current directory:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git add .<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now create a commit:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git commit -m \"Update project documentation\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">A commit records your changes locally. It does not upload anything to the server yet.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Finally, push your commit:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git push<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Your changes should now appear in the Gitea repository.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">A useful habit<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Run <code>git status<\/code> frequently.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It is one of the most useful Git commands because it tells you which files have changed, which files are staged, and whether your local branch is ahead of or behind its remote counterpart.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">8. Get the Latest Changes Before You Start Working<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In a team environment, other developers may have pushed changes since your last visit.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before starting a new task, it is generally a good idea to retrieve the latest changes:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git pull<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This fetches changes from the remote repository and integrates them into your current branch.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A good everyday routine is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git pull<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then make your changes, commit them, and push:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git add .\ngit commit -m \"Describe your changes\"\ngit push<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Important:<\/strong> If Git reports that your local branch and the remote branch have diverged, don&#8217;t immediately try random commands to force a push. Someone may have pushed changes that you don&#8217;t have locally. Read the message carefully and resolve the situation before proceeding.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">9. Use Branches Instead of Working Directly on Main<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">When several people work on the same project, it is usually better to avoid making changes directly on the <code>main<\/code> branch.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A branch gives you an independent line of development. You can work on a feature or bug fix without immediately changing the main version of the project.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, create a branch for a new feature:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git switch -c new-feature<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This creates the branch and switches you to it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Check which branch you are currently using:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git branch<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Make your changes and commit them as usual:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git add .\ngit commit -m \"Add new feature\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Push your branch to Gitea:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git push -u origin new-feature<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>-u<\/code> option establishes the upstream relationship, so subsequent pushes can simply use <code>git push<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Your new branch will now be visible in Gitea.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Create a Pull Request<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Once your work is ready for review:<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>Open your repository in Gitea.<\/li>\n\n\n\n<li>Navigate to <strong>Pull Requests<\/strong>.<\/li>\n\n\n\n<li>Create a new Pull Request.<\/li>\n\n\n\n<li>Select your feature branch as the source and <code>main<\/code> as the destination.<\/li>\n\n\n\n<li>Describe what you changed and why.<\/li>\n\n\n\n<li>Submit the Pull Request.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Your teammates can review your changes, leave comments, request modifications, and eventually merge your work into <code>main<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is a common workflow for development teams and helps prevent unfinished work from accidentally becoming part of the main project.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Your team may have its own branching and review policy, so follow the conventions established by your project maintainers.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">10. What Is a Merge Conflict?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A merge conflict occurs when Git cannot automatically combine changes from different branches.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Alice changes a particular line in <code>index.html<\/code>.<\/li>\n\n\n\n<li>Bob changes that same line independently.<\/li>\n\n\n\n<li>Both developers push their work.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">When Git tries to combine the changes, it may not know which version should be kept.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You may see something like:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;&lt;&lt;&lt;&lt;&lt;&lt; HEAD\n&lt;h1&gt;Welcome to our website&lt;\/h1&gt;\n=======\n&lt;h1&gt;Welcome to the new website&lt;\/h1&gt;\n&gt;&gt;&gt;&gt;&gt;&gt;&gt; main<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">These markers identify the competing changes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You must edit the file, decide what the final content should be, and remove the conflict markers.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After resolving the conflict:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git add index.html\ngit commit<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The exact commands can vary depending on whether you are resolving a merge, a rebase, or a Pull Request conflict.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you are new to Git, don&#8217;t panic. Conflicts are a normal part of collaborative development. Ask a teammate for help if you are unsure which changes should be retained.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">11. Use a .gitignore File<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Not every file in a project should be committed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, you generally don&#8217;t want to upload:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Temporary files.<\/li>\n\n\n\n<li>Operating-system metadata.<\/li>\n\n\n\n<li>IDE settings.<\/li>\n\n\n\n<li>Dependency directories.<\/li>\n\n\n\n<li>Local environment configuration.<\/li>\n\n\n\n<li>Passwords, API keys, or other secrets.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Git uses a file called <code>.gitignore<\/code> to identify files and directories that should not be tracked.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A simple example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Operating system files\n.DS_Store\nThumbs.db\n\n# IDE settings\n.idea\/\n.vscode\/\n\n# Temporary files and logs\n*.tmp\n*.log\n\n# Dependencies\nnode_modules\/\n\n# Environment variables and secrets\n.env\n.env.*\n!.env.example<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Place this file in your project&#8217;s root directory.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A few things to remember:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>.gitignore<\/code> only prevents Git from tracking matching files that are not already tracked.<\/li>\n\n\n\n<li>Adding an existing tracked file to <code>.gitignore<\/code> does not automatically remove it from the repository.<\/li>\n\n\n\n<li>Never commit secrets, even accidentally. If a secret is committed, removing the file in a later commit does not erase it from the earlier commit history. Rotate the exposed credential.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">If your team already has a <code>.gitignore<\/code> file, don&#8217;t replace it without checking with the project maintainers.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">12. Useful Git Commands to Keep Handy<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Here is a quick reference for the commands you will use most frequently:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><th>Command<\/th><th>Description<\/th><\/tr><tr><td><code>git status<\/code><\/td><td>Shows the current state of your working directory<\/td><\/tr><tr><td><code>git add .<\/code><\/td><td>Stages changes in the current directory<\/td><\/tr><tr><td><code>git add filename<\/code><\/td><td>Stages a specific file<\/td><\/tr><tr><td><code>git commit -m \"Message\"<\/code><\/td><td>Creates a commit<\/td><\/tr><tr><td><code>git push<\/code><\/td><td>Uploads local commits to the remote<\/td><\/tr><tr><td><code>git pull<\/code><\/td><td>Retrieves and integrates remote changes<\/td><\/tr><tr><td><code>git clone URL<\/code><\/td><td>Clones a repository<\/td><\/tr><tr><td><code>git log --oneline<\/code><\/td><td>Displays a compact commit history<\/td><\/tr><tr><td><code>git diff<\/code><\/td><td>Shows unstaged changes<\/td><\/tr><tr><td><code>git diff --staged<\/code><\/td><td>Shows staged changes<\/td><\/tr><tr><td><code>git branch<\/code><\/td><td>Lists local branches<\/td><\/tr><tr><td><code>git switch branch-name<\/code><\/td><td>Switches to another branch<\/td><\/tr><tr><td><code>git switch -c branch-name<\/code><\/td><td>Creates and switches to a new branch<\/td><\/tr><tr><td><code>git remote -v<\/code><\/td><td>Displays configured remote repositories<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">You don&#8217;t need to memorize everything. Keep this guide handy and use it as a reference while you become familiar with Git.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">13. A Few Final Tips for Working in a Team<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A few simple habits can save you and your teammates a lot of trouble:<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li><strong>Pull before you start working.<\/strong> Make sure you have the latest version of the branch.<\/li>\n\n\n\n<li><strong>Use descriptive commit messages.<\/strong> &#8220;Fix login validation&#8221; is much more useful than &#8220;Changes&#8221;.<\/li>\n\n\n\n<li><strong>Commit regularly.<\/strong> Small, focused commits are easier to review and understand.<\/li>\n\n\n\n<li><strong>Use branches for new features and bug fixes.<\/strong> Avoid making experimental changes directly on <code>main<\/code>.<\/li>\n\n\n\n<li><strong>Don&#8217;t commit secrets.<\/strong> Passwords, private keys, API tokens, and production credentials do not belong in Git.<\/li>\n\n\n\n<li><strong>Don&#8217;t force-push shared branches.<\/strong> A force push can overwrite commits pushed by other team members.<\/li>\n\n\n\n<li><strong>Communicate.<\/strong> Git helps manage code changes, but it doesn&#8217;t replace communication between developers.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><\/h2>\n\n\n\n<h2 class=\"wp-block-heading\">12. Hands-On: Your First Real Git Project<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Enough theory! Let&#8217;s put everything we&#8217;ve learned into practice.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We&#8217;re going to create a tiny website consisting of three files:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>my-first-project\/\n\u251c\u2500\u2500 index.html\n\u251c\u2500\u2500 style.css\n\u2514\u2500\u2500 magic.js<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">It won&#8217;t be anything spectacular, but that&#8217;s the point. We want to concentrate on learning Git, not building a complicated application.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">By the end of this exercise, you will have created a local project, uploaded it to your Gitea server, modified it, committed the changes, and retrieved it again.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Create Your Project<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Open a terminal and create a directory:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir my-first-project\ncd my-first-project<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Create the three files.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>index.html<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\n&lt;head&gt;\n    &lt;meta charset=\"UTF-8\"&gt;\n    &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"&gt;\n    &lt;title&gt;My First Git Project&lt;\/title&gt;\n    &lt;link rel=\"stylesheet\" href=\"style.css\"&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n    &lt;h1&gt;Hello, Gitea!&lt;\/h1&gt;\n    &lt;p&gt;This is my first project managed with Git.&lt;\/p&gt;\n\n    &lt;button onclick=\"showMagic()\"&gt;Click Me!&lt;\/button&gt;\n\n    &lt;script src=\"magic.js\"&gt;&lt;\/script&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>style.css<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>body {\n    font-family: Arial, sans-serif;\n    text-align: center;\n    margin-top: 80px;\n    background: #f4f4f4;\n}\n\nh1 {\n    color: #333;\n}\n\nbutton {\n    padding: 12px 24px;\n    cursor: pointer;\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>magic.js<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function showMagic() {\n    alert(\"Congratulations! Your first Git project is working!\");\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can create these files using your favourite editor. Alternatively, on Linux or macOS, you can use a terminal editor such as <code>nano<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Your project directory should now contain all three files.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Initialize Git<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s turn this ordinary directory into a Git repository:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git init<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Git has now created a hidden <code>.git<\/code> directory. This is where it stores the repository&#8217;s history and metadata.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Check what Git sees:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git status<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You should see something similar to:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Untracked files:\n  index.html\n  magic.js\n  style.css<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This is Git telling you that it can see the files, but it isn&#8217;t tracking them yet.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Stage Your Files<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Tell Git which files you want included in your next commit:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git add .<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The dot means all applicable files in the current directory.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Check the status again:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git status<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The files should now appear under <strong>Changes to be committed<\/strong>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is the staging area. Think of it as preparing the contents of your next snapshot before saving it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 4: Create Your First Commit<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Now save your first snapshot:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git commit -m \"Initial project\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Congratulations! You have created your first Git commit.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can inspect your history:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git log --oneline<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You should see your new commit listed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">At this point, everything exists locally on your computer. Nothing has been uploaded to Gitea yet.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 5: Create a Repository on Gitea<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Open your Gitea website and sign in.<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>Click the <strong>+<\/strong> button.<\/li>\n\n\n\n<li>Select <strong>New Repository<\/strong>.<\/li>\n\n\n\n<li>Name it <code>my-first-project<\/code>.<\/li>\n\n\n\n<li>Choose whether it should be public or private.<\/li>\n\n\n\n<li>Click <strong>Create Repository<\/strong>.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">For this exercise, leave the repository empty. Do not initialize it with a README, <code>.gitignore<\/code>, or license, because we have already created and committed our files locally.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Gitea will display the repository&#8217;s clone addresses.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Copy the SSH address. It should look something like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gitea@git.example.com:YOUR_USERNAME\/my-first-project.git<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Use the actual address displayed by your server.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 6: Connect Your Local Project to Gitea<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Return to your terminal, making sure you are still inside <code>my-first-project<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Add the Gitea repository as a remote:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git remote add origin gitea@git.example.com:YOUR_USERNAME\/my-first-project.git<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Replace the example address with the one you copied from Gitea.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now make sure your branch is named <code>main<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git branch -M main<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Check the remote configuration:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git remote -v<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You should see your Gitea address listed.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 7: Push Your Project!<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">This is the moment we&#8217;ve been working towards:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git push -u origin main<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Git will send your first commit and its files to your Gitea server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Open your repository in your browser and refresh the page.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You should now see:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>index.html\nstyle.css\nmagic.js<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Your first project is officially hosted on your own Git server!<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 8: Make a Change and Commit It<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s make a small change to <code>index.html<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Find:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;h1&gt;Hello, Gitea!&lt;\/h1&gt;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Replace it with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;h1&gt;Hello, my own Git server!&lt;\/h1&gt;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Save the file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now ask Git what has changed:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git status<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You should see that <code>index.html<\/code> has been modified.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Want to see exactly what changed?<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git diff<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Git will show you the difference between the previous committed version and your current file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Stage the change:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git add index.html<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Commit it:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git commit -m \"Update homepage greeting\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">And push it:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git push<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Refresh your Gitea repository in the browser. The updated version should now be visible.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Notice that we didn&#8217;t need to specify <code>origin main<\/code> again. Git remembers the upstream branch because we used <code>-u<\/code> during our first push.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 9: Simulate Working on Another Computer<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Now let&#8217;s demonstrate something important.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Imagine you are working on your desktop computer and want to continue the project on your laptop.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We can simulate this without needing a second computer.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First, move outside your existing project directory:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd ..<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Clone the repository into a new directory:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git clone gitea@git.example.com:YOUR_USERNAME\/my-first-project.git my-second-copy<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Again, use your actual SSH address.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Enter the new directory:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd my-second-copy<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Take a look at the files:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ls<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You should find all three files, including the updated <code>index.html<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Now let&#8217;s make another change. Open <code>magic.js<\/code> and replace its contents with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function showMagic() {\n    alert(\"Hello from my second computer!\");\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Check the changes:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git status<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Stage and commit:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git add magic.js\ngit commit -m \"Update magic message\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Push the change:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git push<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Your Gitea server now contains this latest version.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 10: Retrieve the Changes in Your Original Project<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Let&#8217;s return to the original project directory:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd ..\/my-first-project<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Remember, this directory still contains the earlier version of <code>magic.js<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Retrieve the latest changes from Gitea:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git pull<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Open <code>magic.js<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You should now see the message from your second copy!<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You&#8217;ve just simulated a very common real-world scenario: working on a project from two different computers and exchanging changes through your Gitea server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>That&#8217;s Git in action!<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">13. Your Git Workflow from Now On<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">After completing the exercise, you should have a much better understanding of the commands you&#8217;ll use every day.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For a typical working session, the process is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Get the latest changes\ngit pull\n\n# See what has changed\ngit status\n\n# Stage your modifications\ngit add .\n\n# Save a snapshot\ngit commit -m \"Describe what you changed\"\n\n# Send your changes to Gitea\ngit push<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You don&#8217;t need to memorize every Git command. Keep this guide handy, experiment with your own projects, and use <code>git status<\/code> whenever you&#8217;re unsure what is happening.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">As you become more comfortable, you can explore branches, Pull Requests, merging, rebasing, and the many other features Git offers.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You&#8217;ve now gone from an empty directory to a working project hosted on your own Gitea server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">More importantly, you&#8217;ve experienced the complete Git workflow rather than simply reading about it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Whether you&#8217;re working alone, switching between computers, or collaborating with an entire development team, the same principles apply.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Welcome to the world of Git, and happy coding!<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\"><em>New to self-hosting? If you want to learn how to install and configure your own Gitea server on Debian, see our companion guide:<\/em> <a href=\"https:\/\/www.voodoo.business\/blog\/2026\/11\/03\/self-hosted-github\/\"><em>Self-Hosted GitHub: Build Your Own Git Server with Gitea on Debian 13<\/em><\/a><em>.<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to Use Your Self-Hosted Gitea Server: A Beginner&#8217;s Guide for Developers You have a self-hosted Git server running Gitea, and your team has invited you to collaborate on a project. Now what? If you have never used Git before, the terminology can be intimidating: repositories, commits, branches, remotes, SSH keys, pushes, pulls&#8230; Don&#8217;t worry. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[160],"tags":[],"class_list":["post-6798","post","type-post","status-publish","format-standard","hentry","category-software-development"],"_links":{"self":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts\/6798","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/comments?post=6798"}],"version-history":[{"count":4,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts\/6798\/revisions"}],"predecessor-version":[{"id":6804,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/posts\/6798\/revisions\/6804"}],"wp:attachment":[{"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/media?parent=6798"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/categories?post=6798"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.voodoo.business\/blog\/wp-json\/wp\/v2\/tags?post=6798"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}