Getting started with gitlab
Inisiasi folder dalam gitlab:
cd existing_repo
git remote add origin https://gitlab.com/sandihex/sims-server.git
git branch -M main
git push -uf origin main
To fetch and synchronize your local repository with the main
branch from the remote repository on GitLab, follow these steps:
-
Fetch the latest changes from the remote repository:
git fetch origin
-
Reset your local
main
branch to match the remotemain
branch:git reset --hard origin/main
This command will force your local
main
branch to match the state of themain
branch on the remote repository, discarding any local changes. -
Ensure you are on the
main
branch:git checkout main
By following these steps, your local repository will be synchronized with the main
branch on the remote GitLab repository. If you have any local changes you want to keep, make sure to commit or stash them before running these commands.