To try this guide for yourself, you will need the following things:
- Git installed on your computer
- A local Git repository initialized or cloned
- Access to a remote Git repository (e.g., GitHub, Gitea)
- Remote repository URL (HTTPS)
If you have no git repository on your computer, you can clone any repository with "git clone". For this guide it would be useful to clone a repository you own. Or you can initialize a folder on your computer as a git repository:
- Option 1:
- Option 2:
$ git clone https://domain.tld/USER/REPO
Now you should navigate into the folder of the git repository.
$ git init
$ git remote add origin https://domain.tld/USER/REPO
Commit & Push
Now you should make some changes to any text file inside the repository, and then follow these instructions to commit to the repository:
- Git status: Use this to view what files were being modified.
- Stage the Changes: Add files to the staging area (prepare them for commit):
- Commit the changes to the local repository:
- Push the changes to the remote repository
$ git status
To add all changed files:
$ git add .
Or add a specific file:
$ git add filename.txt
$ git commit -m "Your commit message here"
$ git push origin main
"main" stands for the branch we are developing on. More on that here.