Skip to main content

Using Git for Source Control and Programming

Hands-On Lab

 

Photo of Terrence Cox

Terrence Cox

Senior Vice President of Content

Length

01:00:00

Difficulty

Intermediate

This activity will allow you to practice using the git source control system. As one of the objectives for the Linux Foundation Certified Engineer, you may be asked to set up, configure and perform basic tasks on a local git instance. Once this activity is complete, you will understand how to install, configure and check files into and out of the git server using the command line.

What are Hands-On Labs?

Hands-On Labs are scenario-based learning environments where learners can practice without consequences. Don't compromise a system or waste money on expensive downloads. Practice real-world skills without the real-world risk, no assembly required.

Your team is going to begin development of a new web-based API. As the supporting system engineer, you have been provided credentials to a new shared development server they will be using. You have been asked to install a local git server instance they can use to track their code changes.

Once you have git installed, create a new repository called 'webapi' in the home directory of the user you are signed in as (for example '/home/cloud_user/webapi' would be the directory to initialize the repository within.

After that is complete, add the appropriate configuration variables to the git configuration so that files can be added, committed and the 'cloud_user' account can clone that repository locally if desired in another location. Create a 'README' with the text 'webapi' inside it and another file called 'currentver.txt' with the text 'v0.1' inside it. Add and check in those files and verify the repository is up to date.

Finally, clone the repo in the directory /home/cloud_user/backup/webapi and verify the test files you created are there. Once complete, you can turn the server over for your team's use.