Set GIT and GITHUB

Price: INR 1,299.00
Was: INR 1,799.00

In this tutorial, we will, How can you Set GIT and GITHUB.

To perform this first you need to setup or install the GIT on your local machine. We have already seen, what is GIT and how we can install the GIT.

 

GIT and GitHub both are the different things GIT is a VCS system, what you can install on your local machine. GitHub is a website, you can’t install it.

GIT is a repository and GitHub is the server used to maintain this repository.

 

GIT helps us to version our code or to upload the code on server and GitHub is the server which keeps the repository.

GitHub is the free server (up to some limit), To use GitHub, First you need to create the account on GitHub (https://github.com/) .

 

Push Code using GIT to GITHUB

We will see, how can we upload the project on GitHub using GIT.

  1. Open Git Bash. (Type GIT Bash in your window run prompt)
  2. First, You need to provide the username in Git bash. This name will display in your commit name. So type command —
    git config –global user.the name “YOUR NAME” (Put your name in quotes)
  3. Tell Git the email address that will be associated with your Git commits. use command —
    git config –global user.email ”email”
  4. Now log-in your GitHub account and Create the New repository. The repository is a folder where we will place our source code files on the server.
  5. To create new Repository on GitHub. Click “+New repository” button.
  6. Enter the name of your repository, I named mine ‘SeleniumBix’. It should be the name of Project, you working on.
  7. Select Initialize this repository with a README.
  8. Click ‘Create repository’ button.
  9. Now go to Git Bash and switch the directory, Where you want to clone this GitHub repository. Like, I want to clone project in my D drive so I will switch to D drive first using command –
    cd d://
  10. Now clone the SSH URL of your repository by click on Clone icon present on the left bottom side of your page.
    Configure GIT with GitHub
  11. Clone the project using command —
     git clone https://github.com/anshulc55/SeleniumBix.git
  12. Now you can switch to your Project directory. Because it is cloned into your local machine. You can switch by command–
    cd SeleniumBix/
  13. Now go to your local and modify the Readme.md file (Modify using Notepad++).
  14. Now go to the base and type command ‘git status’ . It will give you the list of modified and still not committed files.
    Configure GIT with GitHub
  15. To commit the changes on the server, first, you need to add the changes. Use ‘git add’ command to add the changes.
  16. To commit use command ‘git commit -m “My second commit” ‘, here my second commit is the comment.

 

This is all how we can connect the GIT with GitHub and perform the operation using Git Bash. We will learn the GIT in details in GIT Tutorials.

0 Comment

Leave a Reply