Cloud Source Repositories: Qwik Start

 Google Cloud Source Repositories provides Git version control to support collaborative development of any application or service. In this lab, you will create a local Git repository that contains a sample file, add a Google Source Repository as a remote, and push the contents of the local repository. You will use the source browser included in Source Repositories to view your repository files from within the Cloud Console.

Task 1: Create a new Cloud Source Repository named REPO_DEMO:

student_04_f3547d22d614@cloudshell:~ (qwiklabs-gcp-03-e1abab50929c)$ gcloud source repos create REPO_DEMO

Created [REPO_DEMO].
WARNING: You may be billed for this repository. See https://cloud.google.com/source-repositories/docs/pricing for details.
student_04_f3547d22d614@cloudshell:~ (qwiklabs-gcp-03-e1abab50929c)$ 


Task 2. Clone the new repository into your Cloud Shell session
Clone the contents of your new Cloud Source Repository to a local repo in your Cloud Shell session:

student_04_f3547d22d614@cloudshell:~ (qwiklabs-gcp-03-e1abab50929c)$ gcloud source repos clone REPO_DEMO

Cloning into '/home/student_04_f3547d22d614/REPO_DEMO'...
warning: You appear to have cloned an empty repository.
Project [qwiklabs-gcp-03-e1abab50929c] repository [REPO_DEMO] was cloned to [/home/student_04_f3547d22d614/REPO_DEMO].
student_04_f3547d22d614@cloudshell:~ (qwiklabs-gcp-03-e1abab50929c)$ 


student_04_f3547d22d614@cloudshell:~/REPO_DEMO (qwiklabs-gcp-03-e1abab50929c)$ gcloud source repos list
REPO_NAME: REPO_DEMO
PROJECT_ID: qwiklabs-gcp-03-e1abab50929c

student_04_f3547d22d614@cloudshell:~/REPO_DEMO (qwiklabs-gcp-03-e1abab50929c)$ git add myfile.txt
student_04_f3547d22d614@cloudshell:~/REPO_DEMO (qwiklabs-gcp-03-e1abab50929c)$ git status
On branch master

No commits yet

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)
        new file:   myfile.txt

student_04_f3547d22d614@cloudshell:~/REPO_DEMO (qwiklabs-gcp-03-e1abab50929c)$ git commit -m "First file" myfile.txt
[master (root-commit) 5ad71da] First file
 1 file changed, 1 insertion(+)
 create mode 100644 myfile.txt
student_04_f3547d22d614@cloudshell:~/REPO_DEMO (qwiklabs-gcp-03-e1abab50929c)$ 
student_04_f3547d22d614@cloudshell:~/REPO_DEMO (qwiklabs-gcp-03-e1abab50929c)$ git status
On branch master
Your branch is based on 'origin/master', but the upstream is gone.
  (use "git branch --unset-upstream" to fixup)

nothing to commit, working tree clean
student_04_f3547d22d614@cloudshell:~/REPO_DEMO (qwiklabs-gcp-03-e1abab50929c)$ git branch
* master
student_04_f3547d22d614@cloudshell:~/REPO_DEMO (qwiklabs-gcp-03-e1abab50929c)$ git push origin master
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Writing objects: 100% (3/3), 222 bytes | 222.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
remote: Waiting for private key checker: 1/1 objects left
To https://source.developers.google.com/p/qwiklabs-gcp-03-e1abab50929c/r/REPO_DEMO
 * [new branch]      master -> master
student_04_f3547d22d614@cloudshell:~/REPO_DEMO (qwiklabs-gcp-03-e1abab50929c)$ 
student_04_f3547d22d614@cloudshell:~/REPO_DEMO (qwiklabs-gcp-03-e1abab50929c)$ 
student_04_f3547d22d614@cloudshell:~/REPO_DEMO (qwiklabs-gcp-03-e1abab50929c)$ 
student_04_f3547d22d614@cloudshell:~/REPO_DEMO (qwiklabs-gcp-03-e1abab50929c)$ gcloud source repos list
REPO_NAME: REPO_DEMO
PROJECT_ID: qwiklabs-gcp-03-e1abab50929c
URL: https://source.developers.google.com/p/qwiklabs-gcp-03-e1abab50929c/r/REPO_DEMO
student_04_f3547d22d614@cloudshell:~/REPO_DEMO (qwiklabs-gcp-03-e1abab50929c)$ history
    1  gcloud source repos create REPO_DEMO
    2  gcloud source repos clone REPO_DEMO
    3  cd REPO_DEMO/
    4  echo "Hello World" > myfile.txt
    5  git config --global user.email "ketan@example.com"
    6  git config --global user.name "ketan patel"
    7  git status
    8  git add myfile.txt
    9  git status
   10  git commit -m "First file" myfile.txt
   11  git status
   12  git branch
   13  git push origin master
   14  gcloud source repos list
   15  history
student_04_f3547d22d614




No comments:

Post a Comment

AppEngine - Python

tudent_04_347b5286260a@cloudshell:~/python-docs-samples/appengine/standard_python3/hello_world (qwiklabs-gcp-00-88834e0beca1)$ sudo apt upda...