My scrapbook about anything which I learned or want to remember, Sometime about tech tips, thoughts and rambling. If you find anything useful don't forget to give thumbs-up :)

Breaking

Wednesday, March 31, 2021

How to work with Google Source Repository?

Though, You can use any source code management system in your google project but to utilize the Google Source Repositories comes will a little benefits. 
Today, we are going to checkout how we have to configure and use the Google Source Repositories. 

    Google Source Repositories are same as any other git based repositories such as GitHub, GitLab or BitBucket and follows the same protocol as well. So it is really easy to setup and use. Without further ado, Let's jump on the steps we have to execute with assumption you are using a Linux OS- 

1. Create Google Source Repository -

2. Generate the SSH
        If you dont have the SSH keys in your system generate it via below commands - 
    ssh-keygen -t rsa -b 2048 -C "your-email-id@gmail.com" 


If you are using Windows OS, you might need to install OpenSSH tool in your system to enable it for SSH - 

3. Register Your SSH Keys
        You have generated the SSH keys in last step, Next, we have to register it on Google Source Repo - https://source.cloud.google.com/user/ssh_keys?register=true , Here, we have to use public key (*.pub)

4. Clone the Repository
        Now, You can clone the repository by below commands - 
        eval $(ssh-agent); ssh-add ~/.ssh/id_rsa   # If using Linux
   git clone ssh://your-email-id@gmail.com@source.developers.google.com:2022/p/your-project-id/r/repo-name

5. Work with your Repo
        Next, you can start working with your repository as any other git repo system.
   cd  repo-name
   echo "This is a google repo" >> ReadMe.md
   git add ReadMe.md
   git commit -m "This is my initial commit"
   git push -u origin master


        
Like the below page to get the update  
Facebook Page      Facebook Group      Twitter Feed      Telegram Group


No comments:

Post a Comment

Disclaimer

The postings on this site are my own and don't necessarily represent IBM's or other companies positions, strategies or opinions. All content provided on this blog is for informational purposes and knowledge sharing only.
The owner of this blog makes no representations as to the accuracy or completeness of any information on this site or found by following any link on this site. The owner will not be liable for any errors or omissions in this information nor for the availability of this information. The owner will not be liable for any losses, injuries, or damages from the display or use of his information.