Skip to content

ImAliSheraz/git_commands

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

Git Basics Commands for Beginners

This repo will contain all basics git commands and theirs uses.

Step 01

Installing Git on your PC

To download Git:

  • Go to https://git-scm.com/downloads download the software for Windows.
  • Install Git choosing all of the default options.
  • Once everything is installed, you should be able to run following command on the CMD. If it displays the usage information, then Git is installed on your PC.
git

Step 02

Git Configuration

Before you can start using Git, you need to configure it. Run each of the following lines on the command line to make sure everything is set up.
Sets up Git with Your Name

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

Sets up Git with Your Email

git config --global user.email "Email Address"

Makes sure that Git output is colored.

git config --global color.ui auto

Displays the original state in a conflict.

git config --global merge.conflictstyle diff3
git config --list

Step 03

Git & Code Editor

The last step of configuration is to get Git working with your code editor. Below are three of the most popular code editors. VS Code Setup

git config --global core.editor "code --wait"

Sublime Text Setup

git config --global core.editor "'Your Sublime Exe Path' -n -w"

Atom Editor Setup

git config --global core.editor "atom --wait"

Initializing Git Repo and Connecting remote Repo.

Use the git following command to create a new, empty repository in the current directory.

git init

'init' is short form of 'initialize'

Add readme file

git add README.md

Following command will create a commit to your local repo

git commit -m "Your Commit Message"
git branch -M main
git commit -m "Your Commit Message"
git remote add origin [Your GitHub Link]
git push -u origin main

Reference

Udacity Free Course
Version Control with Git

About

This repo will contain all basic git commands and theirs uses.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published