Quickly learn how to host code on Mac to github (detailed description), macgithub
At the beginning, I had been browsing and downloading various types of code on github, and then I had to upload the code without knowing what to do. I just recently spent some time studying the github-hosted code. Here I will explain in detail how to quickly learn how to upload your code through github (Beginner's tutorial, great god has flown through ).
I. What you need to do first
First, you need:
1. Create Your github account: Click here to register, like this
Then enter your account and password.
2. Download the git client: click here
Ii. Terminal Configuration
1. Open the terminal and enter
cd ~/.ssh
This is to check yourssh
If yesssh
Backup, orssh
Generated to another directory (if the configuration does not exist for the first time) and does not exist, you will see the following:
Next you need to use the default parameter to generate ssh, terminal Input
ssh-keygen -t rsa -C xxxxx@gmail.com
Herexxxxx@gmail.com
You registeredgithub
The email address, for examplechw_loveway@163.com
Then, my terminal should enter
ssh-keygen -t rsa -C chw_loveway@163.com
Then press enter
If you want to modifyssh
Generate directory. Enter the path to be generated in bold. If the default path is selected~/.ssh
Lower
2. Open your github and follow the steps below
ClickSSH keys
Then add
The above
Title
: Enter your registered mailbox number. Here ischw_loveway@163.com
key
: Enter your generatedid_rsa.pub
Content in the filecopy
Here
Not foundid_rsa.pub
In this case
copy
Go
Select edit text to open it.
3. Test your account andgithub
If the connection fails, open the terminal and enter
ssh -T git@github.com
If
Hi Loveway! You've successfully authenticated, but GitHub does not provide shell access.
It indicates that you have already connected,
3. upload code to github
Log ongithub
And then click+
, SelectNew repository
The page will jump to the following page.
You must enter
Repository name
: Name of the project you created
Description
: A simple description of your upload Project
Public
: All users are visible.
Private
: You can set the visibility of the specified person.
Here, we generally choosePublic
You can selectPrivate
The following
Initialize this repository with a README
: InitializeREADME
(Project usage introduction and so on). We do not select it here. We will create it later.
Then clickCreate repository
To the next interface,
You don't need to do anything here. Simply follow the steps in the red box to open the terminal and enter
echo "# CHWSwift" >> README.mdgit init...
Refresh yourgithub
You can see
4. Modify Your github Project
You can do this by clickingClone in Desktop
Save the file locally. Here I set the path to desktop and put it on the desktop. Then I added an image to it.
Add an imageSwift_logo.png
View mygithub
When the client clicks changes, it will find a new image and then fill in the description (for example, what I wrote here issecond commit
Andadd picture
) Submit
ClickHistory
You can see your Historical submission records. Here we will find that what I just submitted issecond commit
There is a circle behind it, which means it has not been synchronized to github. ClickSync
You can synchronize. Do not forget this step, or you willgithub
You cannot see your updates,
Refresh our project homepage to see the submitted updates.
5. Final
Some children's shoes ask me how to delete the project on github. In fact, this deletion is a bit different. Specifically, go to your project page and clickSetting
Go to the next page, to the bottom, and clickDelete this repository
Enter your project name, that is, the name of the project to be deleted.CHWSwift
)
The README file is mainly used in the markdown syntax. If you are interested, you can study the README file. Here, the code is hostedgithub
On! Welcome to mygithub
Home page: https://github.com/loveway. if you have any questions, leave a message!
Copyright Disclaimer: This article is an original article by the blogger. Please indicate the source for reprinting. Thank you.