DEV Community

Ranjithdhivya
Ranjithdhivya

Posted on

Git

Create a GitLab repository for the current project.
Copy the GitLab URL for the new repository to your clipboard.
Issue the git init command in the base folder of your development project.
Add all of your project’s files to the Git index and then perform a commit.
Add the GitLab repository as a remote reference for the local project.
Run a git push operation and use the -u switch to set the upstream branch.
Confirm that the files in the local project have been uploaded to GitLab.
Git’s remote push commands for GitLab
For GitLab users who simply want a quick overview of the commands to run in the existing project to push to GitLab, here they are.
*git init
*git add
*git commit -m "Push existing project to GitLab"
*git remote add origin https://gitlab.com/cameronmcnz/example-website.git
*git push
The remote GitLab repository is empty and has no commit history
The local branch is named master, not main
Reffer website ::
https://www.theserverside.com

Top comments (0)