GIT COMMANDS

GIT COMMANDS

OVERVIEW OF GIT

An overview of Git and GitHub, which are popular environments among developers and data scientists for performing version control of source code files and projects and collaborating with others.

You can’t talk about Git and GitHub without a basic understanding of what version control is.

A version control system allows you to keep track of changes to your documents.

This makes it easy for you to recover older versions of your document if you make a mistake and it makes collaboration with others much easier.

Git is free and open source software distributed under the GNU General Public License.

Git is a distributed version control system, which means that users anywhere in the world can have a copy of your project on their own computer; when they’ve made changes.

You can use Git without a web interface by using your command line interface, but

GitHub is one of the most popular web-hosted services for Git repositories. Others include GitLab, BitBucket, and Beanstalk.

BASIC COMMANDS:

There are few?basics commands?of git.

Git init command :

When starting with a new repo we have create it once by cloning repo by using this command.

No alt text provided for this image


Git clone command:

Git clone is a Git command line utility which is used to target an existing repository and create a clone, or copy of the target repository.

No alt text provided for this image


Git add . command:

It moves from working directory to the staging area (That's something in-between your local folder and your local repository.)

No alt text provided for this image

Git status command :

This command allows you to see the state of your working directory.

No alt text provided for this image


Git commit command :

A commit is a snapshot of your repo at a specific point in time.

No alt text provided for this image


Git reset command :

Undoes changes that you have made to files.

No alt text provided for this image


Git log command :

It shows the list of all the commits mad to repo. This command also used to displaying the history of repo.

Or you can simply use git log.

No alt text provided for this image


Git remote –v command :

Shows URLs of remote repositories when listing your current remote connections. By default, listing remote repositories only shows you their shortnames (e.g. "origin"). Using the "-v" option, you will also see the remote's URLs in listings.

No alt text provided for this image


Git branch command :

Git “branch” commads lets make you to create , list and remane and delete branches. Git branch is tightly intregrated with checkout and merge commands.

No alt text provided for this image


Git push command:

The git push command is used to upload local repository content to a remote repository. Pushing is how you transfer commits from your local repository to a remote repo.

No alt text provided for this image


Git pull command :

The git pull command is actually a combination of two other command i.e. git fetch and git merge . Firstly git pull will execute a git fetch scoped to the local branch then git pull will enter a merge workflow.

No alt text provided for this image


And finally your files is on your github profile.

Now following commands are used while hosting website.

1- git init

2- git clone (“repo link”)

3- git status

4- git commit -m "initial commit"

5- git add . (“write file names of your folder”)

6- git status

7- git remote -v

8- git remote add origin (“repo link”)

9- git branch -M main

10-git push -u origin main

11-git pull

BOOM!!!

Your website has been hosted.

ALI AHMAD

Software Engineer @ TenX | Python | Building robust AI solutions for clients

2 年

good job keep sharing your knowledge with community :)

Muhammad Faraz

Trainee Software Engineer @ OSOL | UE Grad 24' | Leetcode 200+ | MERN Stack | JavaScript | React JS | Express JS | Node JS

2 年

Tysm It's simple and very easy to understand ?????

要查看或添加评论,请登录

Mahnoor Rana的更多文章

  • TOOLS FOR DATA SCIENCE

    TOOLS FOR DATA SCIENCE

    Tools for Data science Tools In this document , I will tell you about the tools that we can use while starting data…

    4 条评论
  • METHODOLOGY FOR DATA SCIENCE

    METHODOLOGY FOR DATA SCIENCE

    DATA SCIENCE METHDOLOGY Bussiness Approach : Understanding: The problem that we are trying to solve. Analytical…

    2 条评论

社区洞察