NavBar

Sunday, 19 July 2020

What Is Git?

What is Git?What is pull/push?What is commit??What is version control


Introduction To Git :-

  1. Git  is an open source distributed version control system. Git is created by linus torvalds in 2005.
  2. Git can be used to store content, in that most of the content is related software / application codes.
  3. Version control system helps in handling and maintaining a history of what changes have happened.
  4. Git can provide to create repository, branches etc. Git has a remote repository which i store in a server as welll as on developers local system.This means that all developers can access the code.

Why We Need Version Controlling :-

In big projects or real life project have multiple developers working in parallel.So git can maintain and take care about no code conflicts between developers.
Some times in new version of application client face some problems that time git can provide revert back option as well. That's why we need version controlling.


Goals Of Git  :-

1. Speed

2. Support for non-linear  development (thousands of parallel branches)


Git Workflow :- 


Getting Started With Git :-

1. Create a repository in gitlab.


2. URL :  https://about.gitlab.com/

3. Then open command promt or terminal in your local system


4. Then type following commands

- git init

- git remote add origin <https/ssh address>

- git add .

- git commit -m 'Type Commit Message'

- git push origin <branch name>



Most Useful Git Commands :-

      1. git init :-  

        - Initializing empty repository

     2. git remote add  :-

      - Added local repo address to server

     3. git add .  :-

     - Add changes to repo

     4. git branch :-

     - Check all branches

     5. git checkout -b :-

       - Change the branch

     6. git branch <branch name> :-

       - Create new branch

     7. git commit :-

     - Commit local changes with message.

    8. git pull :-

    - Pull code from repo or server branch

   9. git push :-

    - Push local changes to repo or server

  10. git clone :-

  - Cloning the repo using <ssh/https address>

 11. git status :-

 - Check status of current branch

These are the most useful git commands. 


5 comments: