0% found this document useful (0 votes)
16 views

Comptia Linuxxk0004 14 2 1 Version - Control - With - Git

This document discusses version control with Git. It explains that version control is important for monitoring code changes, approving or denying changes, and rolling back changes. Git was created by Linus Torvalds for maintaining the Linux kernel. The document then provides instructions for getting started with Git including installing it, cloning repositories, configuring user information, initializing a new repository, adding and committing files, and submitting changes to another user's repository through branching.

Uploaded by

dani drumer
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Comptia Linuxxk0004 14 2 1 Version - Control - With - Git

This document discusses version control with Git. It explains that version control is important for monitoring code changes, approving or denying changes, and rolling back changes. Git was created by Linus Torvalds for maintaining the Linux kernel. The document then provides instructions for getting started with Git including installing it, cloning repositories, configuring user information, initializing a new repository, adding and committing files, and submitting changes to another user's repository through branching.

Uploaded by

dani drumer
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Filename: comptia-linuxxk0004-14-2-1-version_control_with_git

Show Name: CompTIA Linux+ (XK0-004)


Topic: Automating Tasks
Episode Name: Version Control with Git
Description: In this episode, Zach and Don

Version Control with Git

[?] Why is version control so important?

Problem

Large development teams


Distributed dev teams
Multiple changes being made at once

Version control

Allows monitoring code changes


Approve/deny/rollback

Git

Developed by Linus Torvalds


Used originally to maintain the Linux kernel

[?] How do we get started with Git?

Installed by default on many distros

sudo yum install git

Download a repo

git clone <url>


git clone https://github.com/donpezet/awsdemophpwebapp.git

Working with a repo

git config --global user.email "[email protected]"


git config --global user.name "Your Name"

[?] What if we are starting from scratch? How do we make our own repo?

Create a new repo

mkdir test;cd test


git init

View status

git status

[?] Now that the repo is initialized, do we just copy our files over?

Add files to be tracked by Git

git add <changed_files>

Add all files to Git

git add .
git status

[?] How do we commit changes to our repository?

Save changes

git commit -m "<description>"

View changes

git log

[?] How do we submit changes to someone else's repository?

Branching

Makes an independent copy of a repo


Changes can be pushed upstream

List branches

git branch

Create a branch

git checkout -b <branch_name>


Push changes to a branch

git commit -a -m "Updated about page"

Switch back to master and resync

git checkout master


git merge <branch_name>
git status

You might also like