Getting started with Cloud Source Repository
- Start a new session in Cloud Shell and run the following command to create a new Cloud Source Repository named
REPO_DEMO
:gcloud source repos create REPO_DEMO
- Clone the contents of your new Cloud Source Repository to a local repo in your Cloud Shell session:
gcloud source repos clone REPO_DEMO
- Go into the local repository you created:
cd REPO_DEMO
- Run the following command to create a file
myfile.txt
in your local repository:echo 'Hello World!' > myfile.txt
- Commit the file using the following Git commands:
git config --global user.email "you@example.com" git config --global user.name "Your Name" git add myfile.txt git commit -m "First file using Cloud Source Repositories" myfile.txt git push origin master
- Browse the sample files you pushed to the repository by opening the Navigation menu and selecting Source Repositories.
- Click
REPO_DEMO
>myfile.txt
to view the file’s contents in the source code browser:
Tag:Google Cloud