Skip to content

Latest commit

 

History

History
146 lines (104 loc) · 4.05 KB

git.md

File metadata and controls

146 lines (104 loc) · 4.05 KB

Using Git and GitHub

Pre-requisites

  • A GitHub Acoount . If you don't have one make it here
  • Git . Install Git here git download
  • Run the setup file,click next

git file

  • Check 2nd checkbox as shown and click next

checkbox

  • Check with use the native window secure channel library and click next

windowcheckbox

  • Check with use MinTTY and click next

checkboxlast

  • Check first two checkbox and click next

checkboxx

  • Installation process start

Installation

Create new repository on Github

  1. Open your Github account . You will see a page somewhat like this . new repository
  2. Click on Start Project Button to create a new project repository.
  3. Alternatively you can also click on the new repository as shown in the bottom corner of the image .
  4. Once you have clicked you'll be directed to this page. new repo1
  5. Enter the repository name you want . Remembere there are some conventions to naming the repositories . When you enter the name wait for a while until the green tick comes as shown in the image .
  6. Then you can Click on the green create Repository button .
  7. Then you will be redirected to the next page. newrepo3
  8. You have succesfully created a new repository on github .
  9. Now we will see how we can push our data in the repository

Using Git

  1. Once you have installed Git on your system we can push our projects through it.
  2. Open Git Bash and you will something like this. git bash
  3. The First two commands you need to run are just to get youself registered on Git.
 git config --global.user "santk97"
    
 git config --global user.email "****@gmail.com"

git2

  • Make sure the username and email you enter are github registered(not necessary but makes work easy)
  1. Now you need to direct your git to the destined folder .For that we use the cd "path" command . In the double quotes you need to enter the full path of your project . git path

5 Now that we have reached ou project folder the first thing we need to do is initialise out git in the project .

git init 

Use this command. It will make a .git folder in your project . gitinit gitnew

6 . Now that we have created the git folder . We will now add the files to be pushed , It can be done in two ways:

  • Selectively
git add filename
  • All Files
git add .

7 . We will use the git add . command git add . 8 . Once we have added , the next thing we need to do is commit these changes .

git commit -m "your commit message"

Remember:The commit message should be a meaningful one . git commit

  1. Next we will connect our GitHub repo with this project using the link given to us on the github page . github link Copy the blue highlighted part

10 . Next we will use the URI Link to connect our project to github .

  1. For that we will use
git remote add origin ** paste here**

git remote add

12 . The last step is to to push the changes to the repository.

git push origin master

git

13 . If everything you have done is correct and followed the guide correctly your github repository should have been updated. gitrepo something like this

  1. In some cases when you push you might have to sign up . Remember : when pushing your network should be working

  2. For the next times you just need to remember these commands in this order

git add . 
git commit -m "your message"
git push origin master 
  1. Some other useful commands are :
git log #tells the log of your commits 

gitlog

git status # used to know the status of the files being tracked or not

git status

17 . Thank you .