Intro to Git & Github Aditya Agarwal Apoorv Aadarsh Soumya Ranjan Mohapatro
Ground Rules Be Present Be Curious Share Aloud Engagement Respect Each Other Stay present and engaged throughout this session Adapt a growth mindset to expand your perspective and keep an open mind. Use the chat window and share thoughts and seek answers. Be mindful of your surroundings, actively listen and apply what you learn in the interactive activities and discussions. With diverse opinions coming in respect each other’s thoughts
We have a ZERO TOLERANCE POLICY for in-person or online harassment of any kind, including but not limited to: Community Guidelines In relation to, but not limited to: ● Neurodiversity ● Race ● Color ● National origin ● Gender identity ● Gender expression ● Sexual orientation ● Age ● Body size ● Disabilities ● Appearance ● Religion ● Pregnancy ● Military status ● Social demographic ● Stalking/following ● Deliberate intimidation ● Harassing photography or recording ● Sustained disruption of talks or other events ● Offensive verbal language ● Verbal language that reinforces social structures of domination ● Sexual imagery and language in public spaces ● Inappropriate physical contact ● Unwelcome sexual or physical attention ● Physical or cyber threats
Command Line Interface and Bourne-Again Shell A CLI is a command line interface where the users type in text commands to interact with the program underlying the interface. The most important aspect of any CLI is it can be easily automated using scripting in some programming languages that it supports. Bash or Bourne-again Shell, is the newer version of the Bourne UNIX shell, and is found in most of Linux based operating systems. It is the default login shell. You can find it even on certain versions of Windows ( WSL, ;) ). Your basic Windows Command Prompt is a perfect CLI, but once you get the taste of bash, there’s no going back, especially if you are interested in DevOps, Scripting and Automation. CLI and Introduction to Bash
On Windows Windows Command Prompt (after adding the environment variable) Hyper Terminal ( Open Source CLI ) Visual Studio Code Terminal ( Ctrl + ` ) Various Ways to Use Bash or any CLI
What is GIT Git is a software for tracking changes in any set of files, usually used for coordinating work among programmers collaboratively developing source code during software development. Version Control System (VCS)
How to install GIT on your local system ?
For git ● Initialize a repository ● Make changes ● Add .gitignore file ● Stage the changes ● Commit the changes ● Create a branch (if required) Workflow
git init → Init git repository git status → Check git status git log → Check git log ( history of previous commit ) git add . → Stage all the changes git add <file_name> → Stage a particular file git commit -m “commit message” → Commit staged changes
Branching in git
Create a branch : git branch <branch_name> Checkout to a branch : git checkout <branch_name> Checkout and create a new branch at same time : git checkout -b <branch_name> Merge 2 branches : 1. Checkout to the branch in which to merge 2.git merge <branch_name> Rebase branch : git rebase <branch_name>
What is Github GitHub is a web-based Git version control repository hosting service. It provides all of the distributed version control and source code management (SCM) functionalities of Git.​
To work in Github ● Fork the repository ● Clone the forked repository ● Create a branch in your local repository ● Make changes to the local repository in your branch ● Stage & Commit those changes ● Push the changes to Github repository ● Create a Pull Request (PR) to the main repository Workflow
Some important additional commands Push Changes to Github : git push origin <branch_name> Pull recent changes from Github : git pull origin <branch_name> Clone a repository from Github : git clone <link_of_github_repo> Commit with old commit message and old commit hash : git commit --amend --no-edit
Can’t remember? Don’t remember. GitHub Desktop is a GUI interface for Git programs, and can easily do all the work you can do with a git shell, but without the need of remembering the commands. Just install, login. You’ll be able to see all the commands in there. It is essentially the Windows XP to the MS DOS, in the way that, you can do the same stuff in both, but you don’t need to remember 100 lines of code to just switch from one folder to another and just click and finish the job. An Easier way to Git : GitHub Desktop

Intro to Git & GitHub

  • 1.
    Intro to Git& Github Aditya Agarwal Apoorv Aadarsh Soumya Ranjan Mohapatro
  • 2.
    Ground Rules Be Present BeCurious Share Aloud Engagement Respect Each Other Stay present and engaged throughout this session Adapt a growth mindset to expand your perspective and keep an open mind. Use the chat window and share thoughts and seek answers. Be mindful of your surroundings, actively listen and apply what you learn in the interactive activities and discussions. With diverse opinions coming in respect each other’s thoughts
  • 3.
    We have aZERO TOLERANCE POLICY for in-person or online harassment of any kind, including but not limited to: Community Guidelines In relation to, but not limited to: ● Neurodiversity ● Race ● Color ● National origin ● Gender identity ● Gender expression ● Sexual orientation ● Age ● Body size ● Disabilities ● Appearance ● Religion ● Pregnancy ● Military status ● Social demographic ● Stalking/following ● Deliberate intimidation ● Harassing photography or recording ● Sustained disruption of talks or other events ● Offensive verbal language ● Verbal language that reinforces social structures of domination ● Sexual imagery and language in public spaces ● Inappropriate physical contact ● Unwelcome sexual or physical attention ● Physical or cyber threats
  • 4.
    Command Line Interfaceand Bourne-Again Shell A CLI is a command line interface where the users type in text commands to interact with the program underlying the interface. The most important aspect of any CLI is it can be easily automated using scripting in some programming languages that it supports. Bash or Bourne-again Shell, is the newer version of the Bourne UNIX shell, and is found in most of Linux based operating systems. It is the default login shell. You can find it even on certain versions of Windows ( WSL, ;) ). Your basic Windows Command Prompt is a perfect CLI, but once you get the taste of bash, there’s no going back, especially if you are interested in DevOps, Scripting and Automation. CLI and Introduction to Bash
  • 5.
    On Windows Windows CommandPrompt (after adding the environment variable) Hyper Terminal ( Open Source CLI ) Visual Studio Code Terminal ( Ctrl + ` ) Various Ways to Use Bash or any CLI
  • 6.
    What is GIT Gitis a software for tracking changes in any set of files, usually used for coordinating work among programmers collaboratively developing source code during software development. Version Control System (VCS)
  • 7.
    How to installGIT on your local system ?
  • 8.
    For git ● Initializea repository ● Make changes ● Add .gitignore file ● Stage the changes ● Commit the changes ● Create a branch (if required) Workflow
  • 9.
    git init →Init git repository git status → Check git status git log → Check git log ( history of previous commit ) git add . → Stage all the changes git add <file_name> → Stage a particular file git commit -m “commit message” → Commit staged changes
  • 10.
  • 11.
    Create a branch: git branch <branch_name> Checkout to a branch : git checkout <branch_name> Checkout and create a new branch at same time : git checkout -b <branch_name> Merge 2 branches : 1. Checkout to the branch in which to merge 2.git merge <branch_name> Rebase branch : git rebase <branch_name>
  • 12.
    What is Github GitHubis a web-based Git version control repository hosting service. It provides all of the distributed version control and source code management (SCM) functionalities of Git.​
  • 13.
    To work inGithub ● Fork the repository ● Clone the forked repository ● Create a branch in your local repository ● Make changes to the local repository in your branch ● Stage & Commit those changes ● Push the changes to Github repository ● Create a Pull Request (PR) to the main repository Workflow
  • 14.
    Some important additionalcommands Push Changes to Github : git push origin <branch_name> Pull recent changes from Github : git pull origin <branch_name> Clone a repository from Github : git clone <link_of_github_repo> Commit with old commit message and old commit hash : git commit --amend --no-edit
  • 15.
    Can’t remember? Don’tremember. GitHub Desktop is a GUI interface for Git programs, and can easily do all the work you can do with a git shell, but without the need of remembering the commands. Just install, login. You’ll be able to see all the commands in there. It is essentially the Windows XP to the MS DOS, in the way that, you can do the same stuff in both, but you don’t need to remember 100 lines of code to just switch from one folder to another and just click and finish the job. An Easier way to Git : GitHub Desktop