Skip to content

Latest commit

 

History

History
79 lines (56 loc) · 5.22 KB

04_Cloud_Automation_Version_Control.md

File metadata and controls

79 lines (56 loc) · 5.22 KB

Cloud Automation Version Control < >

Table of content

Version Control Introduction

Version control systems are software that help you track changes you make in your code over time. As you edit to your code, you tell the version control system to take a snapshot of your files. The version control system saves that snapshot permanently so you can recall it later if you need it. By: Robert Outlaw Link

Version Control Tools

Git Introduction

Git Installation

Install git via Chocolatey.

choco install git

Git Common Commands

Table to list the common commands used in git They are ordered by execution flow.

Command Description
git status Show the working tree status
git fetch Updates the local repository with all remote changes
git pull Fetch from and integrate with another repository or a local branch
git branch List, create, or delete branches
git branch -v -a List, create, or delete branches -all -verbose (Including Remote Branches -- in case you are missing them locally)
Git checkout - - track origin/feature/... Checkout specific branch -- including remote branches if you are missing them locally.Use origin/feature/<WORKITEMNUMBER_WORKITEMDESCRIPTION> (don't include the remote/ before)
git add . Adds all changes in the current directory (and sub directories) to the staging (need commit after)
git add <PATH_TO_FILE> Adds a specific file to the staging (Needs commit after)
git commit -am "Text" Commit the changes (provide a descriptive message like "adds" ,"removes", "fixes" - those commit messages should describe the changes made)
git push Update remote refs along with associated objects

A common sequence to check in code is:

git add .
git commit -am '<COMMITMESSAGE>'
git push

Where add . stages all files. commit -am commits all changes with a given message. And push changes into remote repository. For more details see Save and share code with Git

Repositories

Get Free AzureSubscription and Azure DevOps access through Visual Studio

Links

Next Cloud Automation Software Testing