How to Github
For busy people
I got you. All you need is these.
For new projects
cd .../.../.../project_name
git config --global user.email your-mail-address@mail.com
git config --global user.name username
git init
git add .
git commit -m "comments"
git remote add origin your-repository-url.com
git push origin master
For registered projects
cd .../.../.../project_name
git add .
git commit -m "comments"
git push origin master
Prerequisite
If you are totally new to programming and 'githubbing', you might not have an account for Github.
1. Get an account
Please get an account at Github.
2. Create a sample project
I suppose you've got something. You surely do not need any large projects to show.
If you don't got any, just copy the code below and paste it to memo. Then save it as sample.py.
print('Hello, noobs!')
How to commit and push a project to Github
It's not hard. only takes about 5 minutes as whole process.
1. Register a project to Github
First, login to Github and create a new repository. You can also do that by accessing this link.
https://github.com/new
2. Go to the Terminal you were working on
Just got to the terminal.
cd /Users/Username/Desktop/project
3. Setting up your user info
Setting up your user info. Write your username and mail address that you've used to setup a Github account.
git config --global user.email "your-mail-address@mail.com"
git config --global user.name "your-user-name"
You might get the following error unless you do the setups above.
Author identity unknown
*** Please tell me who you are.
Run
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
4. Initializing Git
Initialize Git. Yeah, initialize it, ... initialize.
git init
5. Add files that you've changed
The dot means adding all the files you've changed. It might take a while.
git add .
6. Commit the files
Commit it.
git commit -m "any comments"
7. Register repository
Go to your github account and access the repository. Then copy the HTTPS link.
Just paste it off. You don't need the parenthesis.
git remote add origin (your-url-link)
8. Push the files
Finally, push the files to remote repository!
git push origin master
There you have it.
Errors I got while pushing
I got this following error while pushing.
error: RPC failed; HTTP 400 curl 22 The requested URL returned error: 400
Solved it by running the code below.
git config --global http.postBuffer 524288000
I also got this error. Too large.
remote: error: GH001: Large files detected. You may want to try Git Large File Storage
Nothing you can do about it. Maybe trying Github Pro would help? but who knows.
when asked for merge
git merge --allow-unrelated-histories origin/main