; HowToComputerLife


How to use Github with GitBash


In this tutorial I will be explaining how to upload your first project to GitHub and how to update it afterwards with Git Bash.


Start off by doing the following:

  1. Make a Github account
  2. Download and install Git Bash

Once you have install git bash, pick a project you want to upload and right click the folder.





Make sure you have a project you want to upload it can be any unfinished project and choose the "Git Bash here" option.




you should have the following screen for your project.

Now we have to make a Github repository so we can store your project on Github.


Make a repository and make it either public or private depending on what you intend to do with the project.
in this situation we wont be using readme option.

Once your repository is made copy your http url:


We will now upload our project to Github via Git Bash.
By using the following line of codes


                $ git init
                
$ git remote add origin git@github.com:username/new_repo
on the "$git remote add origin" you have to add your http url for the repository.
$ git push -u origin master




congratulations you should have your first project uploaded in your repository!


If you get the following error:


do the following in the Git Bash terminal.


                $touch initial
                
$git add initial
$git commit -m "initial commit"
$git push -u origin master




You should have an initial file uploaded to see if its working.
Refresh your github repository and it should have an initial file uploaded.
now in order to upload all the files/folders after the initial file upload, you will have to do the following tricks.


            $git add -A
            
$git commit -m "hi"
$git push





congratulations again! now you definitly have your first project uploaded on Github with Git Bash!



If you wanna update your github with the latest changes just do the following again:

            $git add -A
            
$git commit -m "updated files"
$git push


Hope this article helped you.

Share

www.000webhost.com