How to Upload Your First Codebase to GitHub

Follow the steps given below to upload your first codebase to GitHub:

  1. First of all, you need to install git on Windows. (Download Git from here)

  1. Install the git in default settings.
  2. After installing git, you need to set your name & e-mail address in the Git configuration. This information will be displayed every time you make a new commit.
  3. Type the below command to configure your name:
    git config --global user.name "Your Name Here"

  1. Similarly, you need to configure your email address by typing the command given below:
    git config --global user.email "Your Email Here"

  1. Now, head over to github.com and create a new repository in which you want to push your project.

  1. Now, right-click on the folder containing the codebase which you want to push to GitHub and select “Open git bash here.” I will be pushing an “index.html” file which is inside my Github Demo folder which you can see in the below animation.

  1. On clicking “Git bash here”, a new git bash terminal window will open!
  2. Now, initialize the local directory as a Git repository by typing:
    git init 
  3. Now, you need to add the files to the staging area (git will only track the files inside this area). Run:
    git add .

    Typing the above command will stage all the files inside the local directory. If you want to stage only one file, type: 

    git add "file-name"

  1. The next step is to commit your staged files by typing:
    git commit -m "Type message of your choice here"

  1. Now, copy the link to the repository which you created in step 6.

  1. Now, type :
    git remote add origin <Paste-Git-URL-Here>

     

  1. The last step is to push your codebase to GitHub. Type the command given below :
    git push origin master

Refresh the repository page and you will see that your files are successfully pushed to Github.

Congratulations on uploading your first codebase on GitHub!


Comments(1)

11yearold 1 month, 1 week ago
Sir we need more on python!!!!!