Tuesday, February 15, 2022

EXAMPLES: clone a Repo in GitLab to local Repo


Step 1:-> Go to gitlab.com and select your repository


Step 2:-> Copy the url (Clone URL Https)


Step3:-> Clone it on your local system.

    To clone main branch

        git clone  https://gitlab.com/ramansharma95/springbootmicroservice.git   

    To clone a specific branch

        git clone -b master https://gitlab.com/ramansharma95/springbootmicroservice.git


Step4:- A new directory with repository name will be created.

            cd SpringBootMicroservice

            git branch -M main (-M means only this branch, if other branch is present, it is                                            deleted)

            git pull origin main  # pull the files from main branch


Step 5:- Create a new file in the local repo and push it to the remote repo.

           touch 1.java

           git add 1.java

           git commit -m "1.java file is added"

           git push -uf origin main

No comments:

Post a Comment

Fluentd

Open-source log data collector > why logs? - for compliance (auditing, company, business) - for security (transparency, monitoring, admin...