Upload a Folder to Github Command Line
Using GitHub without the command line
Past Craig Lockwood10 May 2017 Tutorials
If the sight of a terminal or command line frightens you lot, this guide past Craig Lockwood will teach you lot to use GitHub to collaborate with others without e'er touching the command line
This guide will teach you how to:
- Create an account on GitHub.com
- Create a repository
- Manage and create branches
- Commit changes to a repository
- Open and merge pull requests
- Create mentions and word
Introduction
GitHub is now the largest online collection of collaborative works that exists in the world. Developers, engineers and designers all over the earth are using GitHub to interact and share code with others.
Once GitHub has become a part of your working routine, you will wonder how yous managed without it. Even so, there is quite a steep learning curve to using GitHub. In that location are hundreds of tutorials on the spider web to assist beginners get to grips with GitHub, simply most require all-encompassing cognition of using the command line. There is, nonetheless, a fashion of using the most commonly used features without always having to open a control line.
What is GitHub?
Before we learn well-nigh GitHub, it is important to understand what Git is.
Initially developed in 2005, Git has now been become the nigh popular choice amongst developers and engineers to manage lawmaking. Git is what'due south known equally a distributed version command organization. That means when you clone a repository y'all have a complete copy of the entire repository including its history. Think of a repository as a database where records of all changes to your files are kept. A distributed organization like Git means that anyone who has a copy of a repository on a local estimator essentially has a complete backup. Git has gained popularity over contempo years for this and a number of other reasons.
A local repository tracking our commits is fine, but information technology'southward not a fail-safe and doesn't lend itself to collaboration. This where services like GitHub come in.
Tip: GitHub is not unique. There are many alternatives, such as Bitbucket, Beanstalk and Codebase. GitHub, still, is a very pop service and offers a free business relationship, which makes it an ideal option for u.s. to utilise in this guide.
Step 1: Create a GitHub account
Creating an account on GitHub is straightforward, best of all, GitHub is gratis to utilize for public and open source projects. If you would similar to keep your projects (repositories) private and not publicly available there are paid plans - in this instance, a free account volition serve our purposes just fine.
Visit GitHub.com and choice a username. Once you lot have submitted an email address and called a countersign your account will exist active - you are ready to go.
Footstep ii: Create a new repository
A repository (sometimes called a repo) is a container used to organise a project. Repositories contain all of the folders and files needed for your project. This can include text files, images, videos, or any other kind of file you could think of.
For the purpose of this walkthrough, we will create a repository calledTEST-REPO.
- Click the+ sign next to your avatar in the top right corner and selectNew repository.
- Proper noun your repository
TEST-REPO. - Write a brusque description of your project.
- SelectPublic.
- SelectInitialize this repository with a README.
- ClickCreate repository.
A repository calledTEST-REPO will then be created and you will be taken to the repository folio. Note that the URL construction for the repository will begithub.com/account-name/repository-name.
Hither you will see a list of all the files associated with this repository along with a commit message (more of this subsequently) and a engagement/time of when that file was last changed. In our case, we will only see the car-generatedREADME.medico file.
Step 3: Create a new branch
Branching involves diverging from your main line of evolution and continuing to work without affecting that main line. When yous initialize a new Git repository, by default you're checked into themaster branch. Branching can be a smashing manner of working on a feature of a projection without affecting themaster code. When y'all accept finished working on your new characteristic you can so merge your new code into the main codebase, themaster branch.
The diagram in a higher place shows a branch from themain co-operative chosenevolution. Subsequently multiple changes, thedevelopment co-operative is then merged dorsum into themainbranch.
Permit's create a new branch calleddevelopment.
- Select the drop down at the superlative of the file list that says
branch: <potent>master</stiff>. - Create a new branch name, is this case, phone call it
evolution. - Select the blueCreate branchbox.
At this signal, you should accept ii branches, chief and development. Both branches will exist identical as we have nonetheless to makes whatsoever changes. You can check in and out of the ii branches past selecting from thebranch drop downwards list.
Step 4: Make changes and commit them to a repository
Before we go any further, make certain y'all accept selected thedevelopment branch equally we are about to make some changes. When a change is fabricated, these changes are saved every bitcommits. Each fourth dimension you commit it is a good idea to add together a short commit message, this creates a readable history of the project and allows others who may be contributing to the project to empathize what is going on at a glance.
Let'due south start past making some changes to the README.dr. file.
- Select the
README.mefile. - Select the pencil icon in the summit right of the corner of the file viewer.
- In the edit window, type a few lines of text - anything volition do (you tin style the text if you wish using the Markdown syntax)
- Create a commit message where it saysAdd an optional extended description....
- Select theCommit changes push button.
The changes but made to theREADME.md file on thedevelopment branch volition only exist visible on thedevelopment branch, themaster branch volition still show the old, unchanged version of theREADME.me file.
Step 5: Pull requests and merging
So at present we have ii branches, each slightly different as thedevelopment branch has had a alter which we have then committed. To keep themaster co-operative up to engagement, we will now await topull any updates into thechief branch - this is washed using aPull Request.
Pull Requests are what makes GitHub such a keen tool for collaboration. At this point we take fabricated changes to a file ourselves, but in theory, anybody could brand these changes and then enquire for a Pull Request, allowing their edits to be merged into a project. A Pull Request needs to be reviewed before the changes are merged, this prevents bad work from inbound a co-operative.
A Pull Request will highlight the differences (often calledDiffs) in the content betwixt branches. Changes can be additions or subtraction to the content. Additions are highlighted in green whilst subtractions are highlighted in blood-red.
So let's open a Pull Asking for the changes that we fabricated to theREADEME.md file.
- Select thePull Requests tab - just nether the repository title.
- Select the greenNew pull request button.
- Select the best co-operative
masterto compare with the branch which includes the changes made, in this caseevolution.
- If you are happy that you wish to submit these changes, select the greenCreate Pull Request push.
- Just every bit you did when yous created a commit message earlier, write a description of your changes.
- Select theCreate pull request.
The Pull Request is now open. This means that the changes are ready to be merged into themain branch.
The final step to merging the differences between branches is to merge the Pull Request. To practice this, select the light-greenMerge pull asking.
Step 6: Create mentions and discussion
Nosotros mentioned earlier that likewise as an excellent platform for keeping track of versions of your work, GitHub is also nifty at collaboration. Thankfully, Github has a neat mechanism for discussion in the form ofmentions.
When you lot make a Pull Request, you may desire to brand a annotation to a detail collaborator. By using the@ symbol followed past a GitHub username, you can send a message to a collaborator, colleague, or anybody within the GitHub community. This characteristic is keen for flagging issues, errors or areas for farther give-and-take.
Congratulations, y'all now know the basics of using GitHub
You have at present learnt to apply GitHub for collaboration with others. There are plenty of further resources should you wish to learn more about using GitHub. Some of our favourites are listed below:
- Git for humans
- GitHub menstruation guide
- GitHub for beginners
Source: https://pixelpioneers.co/blog/2017/using-github-without-the-command-line
0 Response to "Upload a Folder to Github Command Line"
แสดงความคิดเห็น