Commonly used Git Commands in Gitlab
What is GitLab?
GitLab is a single application that spans the entire software development lifecycle. GitLab is an open-source project maintained by GitLab Inc with over 3,000 contributors. We can install and self-manage the GitLab Community Edition which is fully open-source under an MIT license.
Step 1 – Login to GitLab using your username and password.
Step 2 – In the dashboard, click the blue New project button. This opens the New project page.
Step 3 – Select Create a blank project.
Step 4 – A new page will open. Provide the following information on that page:
Step 5 – For every remote repo, you will get a unique URL as highlighted below. This URL is used to push the local changes to this remote repo. Type the below command in GitBash:
git remote add origin http://183.82.99.133:8012/gitlab/rajamohan/biometric_app.git
To open GitBash, go to the location where the project is saved and Right Click and Select GitBash Here.
Add remote URL to local GIT Repository
git remote command provide the name to direct link to Repositories.
git remote command are used in conjunction with the git fetch, git push, and git pull commands.
git remote -v
Step 6 – To push the changes from GIT Local Repository to GitLab in a particular branch of the remote repo, we need to use the below command:
git push <remote url or name> <branch name>
git push origin master
Now run the Git push command, It will ask for your GitLab credentials. Please provide the username and password used to log in to GitLab.
git push origin master
All the files from the local GIT Repository are moved to GitLab Remote Repository.