How To Upload Git Repository To Github
Adding a file to a repository on GitHub
Files that y'all add to a repository via a browser are express to 25 MB per file. You can add larger files, up to 100 MB each, via the control line. For more information, run into "Adding a file to a repository using the command line."
Tips:
- You can upload multiple files to GitHub at the aforementioned time.
- If a repository has whatsoever protected branches, you can't edit or upload files in the protected branch using GitHub. For more information, see "Most protected branches."
You tin use GitHub Desktop to move your changes to a new branch and commit them. For more data, see "Committing and reviewing changes to your project."
- On GitHub.com, navigate to the master page of the repository.
- Above the list of files, using the Add together file drop-downwards, click Upload files.
- Elevate and drop the file or binder you'd like to upload to your repository onto the file tree.
- At the bottom of the folio, type a short, meaningful commit bulletin that describes the alter you made to the file. Y'all can aspect the commit to more than one writer in the commit message. For more than information, see "Creating a commit with multiple co-authors."
- Beneath the commit message fields, decide whether to add your commit to the current branch or to a new branch. If your current co-operative is the default branch, you should choose to create a new branch for your commit so create a pull request. For more data, meet "Creating a new pull request."
- Click Commit changes.
Adding a file to a repository using the command line
You can upload an existing file to a repository on GitHub.com using the command line.
This process assumes you lot've already:
- Created a repository on GitHub, or have an existing repository owned by someone else yous'd like to contribute to
- Cloned the repository locally on your reckoner
Warning: Never git add
, commit
, or push button
sensitive information to a remote repository. Sensitive data can include, but is non express to:
- Passwords
- SSH keys
- AWS admission keys
- API keys
- Credit card numbers
- PIN numbers
For more data, run across "Removing sensitive information from a repository."
- On your reckoner, motion the file you'd like to upload to GitHub into the local directory that was created when you cloned the repository.
- Open Terminal Terminal Git Bash.
- Change the current working directory to your local repository.
- Stage the file for commit to your local repository.
$ git add . # Adds the file to your local repository and stages information technology for commit. To unstage a file, use 'git reset Caput YOUR-FILE'.
- Commit the file that you've staged in your local repository.
$ git commit -m "Add existing file" # Commits the tracked changes and prepares them to be pushed to a remote repository. To remove this commit and modify the file, utilise 'git reset --soft Head~one' and commit and add the file again.
- Push the changes in your local repository to GitHub.com.
$ git push origin your-branch # Pushes the changes in your local repository upwardly to the remote repository y'all specified as the origin
Further reading
- "Adding locally hosted code to GitHub"
Source: https://docs.github.com/articles/adding-a-file-to-a-repository
Posted by: leetwentortund.blogspot.com
0 Response to "How To Upload Git Repository To Github"
Post a Comment