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 yoursshIf yessshBackup, orsshGenerated 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.comYou registeredgithubThe email address, for examplechw_loveway@163.comThen, my terminal should enter
ssh-keygen -t rsa -C chw_loveway@163.com
Then press enter
If you want to modifysshGenerate directory. Enter the path to be generated in bold. If the default path is selected~/.sshLower
2. Open your github and follow the steps below
ClickSSH keysThen add
The above
Title: Enter your registered mailbox number. Here ischw_loveway@163.com
key: Enter your generatedid_rsa.pubContent in the filecopyHere
Not foundid_rsa.pubIn this case
copyGo
Select edit text to open it.
3. Test your account andgithubIf 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 ongithubAnd 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 choosePublicYou 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 repositoryTo 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 yourgithubYou 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 mygithubWhen the client clicks changes, it will find a new image and then fill in the description (for example, what I wrote here issecond commitAndadd picture) Submit
ClickHistoryYou can see your Historical submission records. Here we will find that what I just submitted issecond commitThere is a circle behind it, which means it has not been synchronized to github. ClickSyncYou can synchronize. Do not forget this step, or you willgithubYou 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 repositoryEnter 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 hostedgithubOn! Welcome to mygithubHome 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.