Git

Git is a Distributed Version Control System and open source project originally developed by Linux Torvalds in the year 2005.  Git is flexible and more secure. 









GitHub

GitHub is a platform where you can showcase your work over the internet and can also work on a project with others who are across the globe. Before using github you need to create an account that is free of cost. So the project that we developed on our local system can be pushed to the github in two ways.

1. Doing manually like going to the website and pushing our project.
2. Using the Git Bash. 



To start off with Github we need to know some of the commands in github

1. $ git init : initialize git.

2. $ ls -a : To view list of directories.

3. $ pwd : present working directory.

4. $ git status : To check status of the files.

5.  git add
      1. $ git add . : addes all the files.
              2. $ git add * : addes all the files.
      3. $ git add --all : addes all the files.
      4. $ git add -A : addes all the files.
      5. $ git all index.html : to add single files.

6. $ mkdir : to create a folder

7. $ git commit -m "any msg" : to commit the changes.

8. $ git config --global user.name "username"

9. $ git config --global user.email "email"

10. $ git config --list

11. $ git log : shows all the commits.

12. $ git remote add origin https://...

13. $ git remote

14. $ git push origin master.

15. $ git pull origin master.

16. $ git clone.


1. Doing manually from the browser



1. First we need to create an account if not yet created. Go to the website here





2. After creating an account sign in to our account with the credentials. After signing in you can see
a plus icon on the top right corner of your screen. Click on the plus icon 





3. Click on the create a new repository to create a repository 
  
                     



4. You can see a page like this give a name to your repository which must be unique from your repositories. You can keep your repository public or private and click on create  repository




5. You will be redirected to the above page click on the upload existing files and click on choose files
 and click on commit changes to push your files to your repository.

 
6. Successfully you added your files to your repository 😊. 


2. Using Git Bash


If you haven't installed git bash on your computer then download and install git bash from here

1. Create a folder and open git bash in that folder.


2. Click on git bash to open git bash in the particular directory.



3. A git bash prompt should be open like this.

4. Use the command $ git init to initialize a git in your project.

5. for create files use the command $ touch index.html.

6. To check the status  use the command $ git status.



7. The files which are shown red are not add so to add the files use the command git add --all.

8. After adding files you should commit your changes use the command.
                  $ git commit -m "files added"


9. Now you used configure username and your email.
     $ git config --global user.name "hrudai2002"
     $ git config --global user.email "hrudai2002@gmail.com"



10. After configuring your usrname and email go to github.

11. As mentioned in the above explaination create an repository with same folder and name the repository with same name that you named your folder on local system.

12. Use this commands
   
     
    

The above page comes when you create an repository now use the commands to push the repositories.




                                                                       

                             



13. Use successfully added your files to your repository 😊.


If you will this is informative please share with your friends and comment your views thank you.