Skip to content

BhavyaRohilla/Git-Github-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Version Control System :-

  1. Version control is a management software responsible for managing changes to computer programs, documents, large websites, or other collections of information.
  2. Easy recovery of files/folders.
  3. Rollback to the previous versions.
  4. Informs us about Who, What, When, Why changes have been made.



History of VCS :-

Local VCS :-

  1. Changes are stored in a database, along with timestamp.
  2. Code is in Local System.

Cons : Project can be lost, if your hard-disk is corrupted.


Centralized VCS :-

Repository :-

A directory where your project resides. It can be a local folder in your computer or a remote directory on a server.

There are 2 types of repository :-

  1. Local Repository
  2. Central Repository

Centralized VCS contain just one repository i.e central repository and each user gets to work on the same.


Alt text


Cons :

  1. If the central repo goes down even for an hour.
  2. You'll lose the project if the hard disk of the central server goes down.

Distributed VCS :-

  1. Distributed version control systems contain multiple repositories. Each user has their own local repository & there is a central repository where the final code resides.
  2. Provides full Back-up of the project.
  3. Git is an example of distributed VCS.

Alt text





How is Git created?

"Git was created in 2005 by Linus Torvalds. (creator of Linux kernel)"

Git :-

  1. Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
  2. Git stores snapshot of your project (not differences)

Alt text


Git Features :-

  • Collaboration
  • Storing Versions
  • Analyse the code changes
  • Distributed.
  • Almost everything is Locally.
  • Non-linear/Branching.
  • Secure/Integrity.
  • Speed.




Setting Up the Environment

"For Windows : Use Git Bash"

"For Mac-os / Linux : Use Terminal"


# To check the git version :-

  • git --version

# configuration of global variables

  • git config --global user.name "Bhavya Rohilla"
  • git config --global user.email "[email protected]"

Alt text

Alt text

Git Config list :-

List all variables set in config file, along with their values.

  • git config --list

  • Alt text





    Command Line Tool

    "For Windows : Use Git Bash"

    "For Mac-os / Linux : Use Terminal"


    1. pwd(Print working directory) :-

    In Unix-like and some other operating systems, the pwd command (print working directory) writes the full pathname of the current working directory to the standard output.

    Alt text


    2. ls(list) :-

    The ls command is used to list files. "ls" on its own lists all files in the current directory except for hidden files.

    Alt text


    Others ls :-

    1.) ls -l : Show list with details.

    2.) ls -a : Show hide items with details.

    3.) ls -al : Combine 1,2.


    3. Change Directory :-

    The cd command allows you to move between directories. The cd command takes an argument, usually the name of the folder you want to move to, so the full command is cd your-directory . Now that we moved to your Desktop, you can type ls again, then cd into it.


    Alt text

    4. cd .. :-

    this command is used to move to the parent directory of current directory, or the directory one level up from the current directory. “..” represents parent directory.


    Alt text


    5. Create Files & Folders :-


    • mkdir :- The mkdir stands for 'make directory'. With the help of mkdir command, you can create a new directory wherever you want in your system. Just type mkdir dir name , in place of dir name type the name of new directory, you want to create and then press enter.


      Alt text


    • mkdir dir dir dir :- Create multiple Directories.


      Alt text


    • mkdir dir/dir:- Create Directory in Directory.


      Alt text


      Alt text


    • touch file.txt:- The touch command is a standard command used in UNIX/Linux operating system which is used to create, change and modify timestamps of a file.


      Alt text


    • open file.txt:- open a file.


      Alt text


    5. Remove Files & Folders :-


    • rm file.txt:- Use the rm command to remove files you no longer need.


      Alt text



    • rm f3/file.txt:- remove file in directory.



    • rmdir dir:- The rmdir command removes the directory, specified by the Directory parameter, from the system.


    • rm -R dir:- To delete a directory with all its content recursively use rm command with argument -R. Use the argument -f with the argument -R to delete the directory forcefully.

    About

    No description, website, or topics provided.

    Resources

    Stars

    Watchers

    Forks

    Releases

    No releases published

    Packages

    No packages published