*After creating account in gitlab *
First we need to push our project from our local repo to remote repo
*how to do *
step1- Go to gitlab --> Click your profile ---> then left side 3rd option click the groups --> then click your project group and enter into your project file----> there you can see the code option in the right top click that ----> there select HTTP code ----> there are some 5 line commands
1.from the above
first need to open terminal from the place where the project file has
the give the cmd
git statusthis show status of the git ----> then
enter the first linegit init --initial-branch=main --object-format=sha1then next line----> .
git remote add origin https://gitlab.com/akilan46-group/Akilan46-project.gitthen next line--->git add .then next line--->
git commit -m "Initial commitafter enter this line we can expect an error.*Because we didn't generate token *
TO generate the token
steps should that follwed---->
click profile----> preference----> acesss----> personal access token-->generate token ----> legacey token..
Then past this line
git remote set-url origin https://<userName>:<token>@-project pathschange the username , token ,project path..After doing the above step enter the last line
git commit -m "Initial commit"----> then peoject has push to your remote repo
git push --set-upstream origin main
*Hosting the peoject *
we need to add a file in the local folder called .gitlab-ci
pages:
stage: deploy
script:
- mkdir public
- cp -r * public/
artifacts:
paths:
- public
only:
- main
add manual the file in the local folder
open terminal
------> get status -----> cmd git add . -----> git commit m"hosting file"-----> git push.
- the file we pushed is hosting file in gitlab the right side you can see the
Git labpage
*That is host link you can click there and add / your file name *
the project will sucessfully host :
_If you found 404 error _ ----> go to setting---> general---> visibility---> page change acess to everyone.
Then the project will be visible to every via sharing the link


Top comments (0)