Skip to content

NeerajSh-16/LearningGit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 

Repository files navigation

LearningGit

Starting to learn how to work with git.


Author ~ Neeraj Sharma

1st Command :
git init
It creates a new git repository

2nd Command :
git clone (link of the repository)
It clones the respective repository from a remote server on your system

3rd commad :
git status
    There are 4 types of status for a file
  1. Untracked : New file that git doesn't track yet
  2. Modified : A modified file
  3. Staged : File is ready to be committed
  4. Unmodified : Status of your file after making its commit

4th Command :
git add <-file name->
It adds new or changed files in your working directory to the git staging area

5th Command :
git commit -m "some message"
it is the record of your changes

6th Command :
git push origin main
Apne local system par humne jo bhi changes kare hote hain unko dakka dekar github ke upar bhej dete hain

6th Command :
git push origin main
Apne local system par humne jo bhi changes kare hote hain unko dakka dekar github ke upar bhej dete hain

7th Command :
git remote
In Git, the term remote is concerned with the remote repository. It is a shared repository that all team members use to exchange their changes.
For more information about this command visit Git Remote Info

8th Command :
git branch
Gives us details about the branches

9th Command :
git checkout
To come out from a certain branch

10th Command :
git checkout -b <-branch name->
To go to the specified branch. If no such branch exists then a new branch of the given name will be created then we'll be taken to the specified branch

11th Command :
git branch -d <-Branch Name->
To delete the specified branch
NOTE : You should not be on that branch while trying to delete that branch otherwise you will get error

12th Command :
git push origin featureX (other than master)
To publish the code that you have written on the branch feature 1

13th Command :
git pull origin master
To fetch and download content from a remote repo and immediately upadte the local repo to match that content


Now, we'll see how to merge two brnches

Method 1

  • git diff <-branch name->
    (used to compare commits, branches and more)
  • git merge <-branch name->

Method 2

By creating a Pull Request


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages