Files
gitea-pages/docs/guides/git.md
Noah Pombas 656fae3f82
All checks were successful
Build and Deploy Documentation / build-and-deploy (push) Successful in 4s
Updates git log Guide
2025-12-05 09:57:25 +01:00

1.5 KiB

Git


Clone a repository

Copy an existing remote repository to your local machine.

git clone <repository_url>

Example:

git clone https://github.com/user/repo.git

Pull changes from remote

Fetch and merge changes from a remote repository to your local branch.

git pull <remote> <branch>

Example:

git pull origin main

Push changes to remote

Upload local commits to a remote repository.

git push <remote> <branch>

Example:

git push origin main

Rebase branches

Reapply commits on top of another base tip.

git rebase <branch>

Example:

git rebase main

Initialize a new repository

Create a new Git repository in the current directory.

git init

Manage remotes

  • Add a remote:
git remote add <name> <url>
  • Set/Update remote URL:
git remote set-url <name> <url>
  • Remove a remote (e.g., origin):
git remote remove origin

Commit changes with GPG signature

Sign your commit with a GPG key.

git commit -S -m "Your commit message"
  • -S → sign commit with GPG key
  • -m → commit message

Notes

  • To check the configured remotes:
git remote -v
  • To see commit history:
# Those options only add Styling,
git log --oneline --graph --all --decorate

# Plain Text Log,
git log 

  • Stage changes before committing:
git add <file>
git add .  # stage all changes