Common Git Commands - PowerPoint PPT Presentation

About This Presentation
Title:

Common Git Commands

Description:

Git servers the purpose of tracking changes to files and directories. The functionality of Git can be accessed via the command line. – PowerPoint PPT presentation

Number of Views:478
Slides: 17
Provided by: htshosting
Category: Other

less

Transcript and Presenter's Notes

Title: Common Git Commands


1
Common Git Commands Deployment Benefits and Best
Practices
2
Table of Contents
  • Git
  • Git Uses
  • Gits Functionality
  • git clone
  • git add
  • git commit
  • git checkout
  • git rm
  • git fetch
  • git pull
  • git merge
  • git push

3
Git
  • Git refers to a system, which is meant for
    tracking changes to files as well as directories
    (a version control system). Git records all the
    changes in content, and stores the history
    related to every change. Repositories, which are
    a type of data structure, are used by Git for
    managing files. Repositories are present within a
    specific directory. These contain the files as
    well as a record with regard to changes. The
    multiple sets of changes that exist within a
    repository are separated by branches.

4
Git Uses
  • Git is usually used by software developers for
    managing codes. Git can be used by anyone for
    managing any type of file. The flexibility of Git
    enables the use of Git for both, simple as well
    as complex projects. Git-managed content can be
    configured as per ones needs. This is made
    possible through multiple branches and
    repositories. There are certain features in Git,
    which enable the viewing of information with
    regard to revisions, as well as aid in finding
    the cause of an issue, and manipulate changes.

5
Gits Functionality
  • The command line is used to access all of Gits
    functionality. Some of its most common commands
    and options are listed in the following slides.
  • The information contained here isnt
    comprehensive, and information about intermediate
    as well as advanced Git functionality have been
    omitted.

6
1-800-123 -8156
  • Whoa! Thats a big number, arent you
    proud?

7
Git Clone
  • It is a command that is meant for cloning a
    repository into a new directory. It also creates
    remote-tracking branches, as well as forks a new
    working branch from the active branch of the
    cloned repository.
  • The git fetch command should be used to update
    the remote-tracking branches of the new
    repository.
  • The git pull command should be used for merging
    the remote master branch into the current master
    branch.
  • The Git Version Control interface in cPanel
    provides the URL, which is used for cloning the
    repositories of each account.
  • cPanel gtgt Home gtgt Files gtgt Git Version Control

8
Git Add
  • This command is used for adding a files current
    version to the index of staged content for the
    next commit.
  • Only the current changes for the current commit
    are staged by this command. When a commit is
    created again, the command for the file needs to
    be run again. This is needed to stage any new
    changes.

9
Git Commit
  • This command is meant for creating a new commit
    for the currently-staged changes.
  • Use the git add or the git rm commands for
    staging changes for inclusion in a commit, or
    individual filepaths can be provided as arguments
    to this command.

10
Git Checkout
  • Through this command a specified branch can be
    set as the current working branch.
  • This command needs to be run with a file path,
    rather than a branch name, for the purpose of
    checking out only a specified file.
  • If the branch name is omitted, Git will check out
    that file from the current branchs HEAD.

11
Git RM
  • This command serves the function of removing
    directories or files from Gits index, and
    working tree.
  • The specified file should not contain uncommitted
    changes, if this command needs to be run.
  • This command isnt capable of retaining the file
    in the index, and removing it from the working
    tree. To get that done, you have to use BASHs rm
    command.

12
Git Fetch
  • Branches, tags, as well as their histories are
    downloaded by this command from one or more
    repositories.

13
Git Pull
  • This command is used for fetching and merging
    changes from a local branch or from a remote or
    local repository. Usually, this command combines
    the git fetch and the git merge commands.

14
Git Merge
  • This command is meant for combining the history
    of one or multiple commits into the current
    branchs history.

15
Git Push
  • This command is used to add the committed changes
    to that repository and branch, which have been
    specified. A repository needs to be explicitly
    specified, in order to specify a branch. If a
    branch isnt specified, the command adds the
    changes to the current branch of the remote
    repository.
  • The Git Version Control feature in cPanel
    automatically adds a post-receive hook. This is
    triggered by each push to cPanel-manged
    repositories.
  • To digress, cPanel is a web hosting control
    panel. Web hosting is a service provided by web
    hosting companies for making websites accessible.
    Web hosting can be of many types. For example,
    terms such as Linux Shared Hosting, and
    Windows Shared Hosting, refer to a type of web
    hosting that is shared and Linux-based.

16
Thanks!
  • ANY QUESTIONS?
  • www.htshosting.org
  • www.htshosting.org/best-web-hosting-company-India
  • www.htshosting.org/best-windows-hosting
  • www.htshosting.org/best-cloud-hosting-company
Write a Comment
User Comments (0)
About PowerShow.com