Skip to content Skip to sidebar Skip to footer

How to Properly Upload Code to Github

A lot of students ask questions about open source. What is open source, how tin can I contribute to it? Is it helpful if I contribute to open source, and the list goes on relevant to "Open Source".

So what is open source???

Co-ordinate to opensource.com, The term "open-source" refers to something people can modify and share considering its pattern is publicly accessible.

The term originated in the context of software development to designate a specific approach to creating calculator programs. Today, nevertheless, "open up-source" designates a broader set of values — what we call "the open up source way." Open source projects, products, or initiatives cover and gloat principles of open substitution, collaborative participation, rapid prototyping, transparency, meritocracy, and community-oriented development. i.east., "open-source is what is free to admission by all. Anyone tin can alter and distribute its own model".

There are and then many blogs available on the internet to learn about open source, software, and their importance. The most common and widely used platform to apply for open source is Git and GitHub.

add-projects-on-github

The purpose of Git is to manage a project, or a ready of files, as they change over fourth dimension. Git stores this information in a data structure chosen a repository. A git repository contains, among other things, the post-obit: A set of commit objects.

GitHub is a Git repository hosting service, just information technology adds many of its own features. While Git is a control-line tool, GitHub provides a Spider web-based graphical interface. It besides provides access control and several collaboration features, such as wikis and basic task direction tools for every project.

Let's discuss some control used in git to push, pull, commit and do changes to your GitHub repository.

  • First, install Git from the official site https://git-scm.com/downloads and install it in your PC then after creating your profile on Github https://github.com, make a repository and clone (copy the link of your repository) your repository with HTTPS.
  • Now go to Git Fustigate software and use this control to clone this repository to your PC.
    git clone [your re-create link]

    git-clone

  • Git Bash don't use ctrl+5 to paste any segment so paste your link by using shift+Ins key
  • Now yous have cloned your Github repository to your system now add together all you relevant codes in that cloned directory to upload it to your GitHub Profile.
  • Now when you will blazon command git condition you will see all those files you lot take added to the directory in red-colored untracked file segment like this. Here laddu.txt is the unracked file that I have just moved to the directory.

    git-status

  • At present to add these files into staging area (Staging is a step before the commit process in git. That is, a commit in git is performed in two steps: staging and actually commit. As long as a changeset is in the staging area, git allows you to edit it equally yous like to replace staged files with other versions of staged files, remove changes from staging, etc.) utilise control
    git add <files_Name with their respective extensions>

    git-add

  • Here you lot tin run into that at present your files are successfully added to the staging surface area. Now you demand to commit these files with a description. And to do and so use
    git commit -grand "Your description"

    git-commit

  • Now we have committed these changes in our local system and to upload these changes to our remote profile apply command
    git remote -v

    git-remote

  • Great, Now merely 1 stride left this is to push these changes in our Github repository. Use the control beneath to upload your files or any changes.
    git push origin master

    git-push

Great You have successfully uploaded your files to your GitHub repository.

github

All the files and directories are uploaded to your Github account. Now you lot can manage, revert, admission or do any changes in your repositories like this.

hutchinsmoulde.blogspot.com

Source: https://www.geeksforgeeks.org/how-to-upload-a-project-on-github/

Post a Comment for "How to Properly Upload Code to Github"