Skip to content

Latest commit

 

History

History
92 lines (59 loc) · 1.87 KB

05-Practice-Test-Cloning-Remote-Repositories.md

File metadata and controls

92 lines (59 loc) · 1.87 KB

Practice Test - Cloning Remote Repositories

Solutions to practice test - cloning remote repositories

  • Run cd /home/max; git clone http://git.example.com/sarah/story-blog.git

    $ cd /home/max
    $ git clone http://git.example.com/sarah/story-blog.git
    
  • Check the contents of the cloned repository. Confirm that you can see Sarah's story and history of commit by running git log and validate author info, commit message etc.

    $ cd /home/max
    $ git log
    
  • Max has written his story about The 🦊 Fox and Grapes 🍇 View the file he created and its contents. You may read the story if you wish to. But don't spend all day 😝

    $ cd /home/max
    $ cat fox-and-grapes.txt
    
  • Run git add fox-and-grapes.txt and then git commit -m 'Added fox-and-grapes story'

$ cd /home/max
$ git add fox-and-grapes
$ git config user.email "max@example.com"
$ git config user.name "max"
  • Run the git remote -v command to check the remote repository

    $ git remote -v
    
  • Run git push origin master

    $ cd /home/max
    $ git push origin master
    
  • The account owner - Sarah needs to add you as a collaborator. While logged in to the Gitea UI as user sarah go to Settings -> Collaborators of the project and add max as collaborate with Write permissions.

    From GUI --> Repositories --> sarah/story-blog --> settings --> collaborators
    
  • Simply run git push origin master to push and input login credentials

    $ cd /home/max
    $ git push origin master