GitHub code upload and github code upload

Source: Internet
Author: User
Tags sourcetree

GitHub code upload and github code upload
Method 1

 

After logging on to GitHub, click the New responsitory button shown below

You can also click the green button New repository to create a New remote repository. After clicking this button, the following page is displayed:

Repository name (preferably in English)

Description (optional)

Initialize this repository with a README whether to create a README project description file

Add. gitignore ignore file: select based on the project Language

Add a license open source license agreement

With SourceTree

Finally, click Create repository to generate a remote repository. Then open the SourceTree software (if it is not installed, Baidu can find resources to install it on its own ),

Click [new repository]-> [clone from URL], and then jump into a new interface.

Copy the URL created remotely to this [source URL]

Is the red box.

Create an empty folder MVP_DesignModel.

Note:

① Add the code in the project to the MVP_DesignModel file. In this case, it cannot be changed to the folder of the local library. Because there are files in it, the folder must be empty;

② Open the MVP_DesignModel folder and the folder is empty. However, if you select [Destination path], it still prompts non-empty files because there may be hidden folders.

 

To test whether the MVP_DesignModel is successfully added as a repository, you can add a file to it. If the "File status" in SourceTree shows that a new file has been added, it indicates that it has been added successfully.

 

 

Then, create a local folder MVP_DesignModel (note that this folder must be empty; otherwise, even if it becomes required). Set the target path to the newly created MVP_DesignModel path. Click Clone!

 

Create a local database without SourceTree and enter the database on the terminal.

①. Cd to the target folder.

②. Git init(Create a new git repository on the local machine)

③. Git add- 

④. Git remote add origin xxxxxxxxx xxxxxxThe address of your repository. You can copy the address on Github. Associate with a remote repository. Such as the place in the red box.

⑤.Git commit-m "firstCommit"

6.Git pull -- rebase origin masterUpdate a remote update to a local device:

 

Push local updates to remote:

7.Git push origin master (git push-u origin master) combines the local repo with the remote origin repo. The first time-u is used, the system requires that the account and password be entered.

Invalid.Git pull(Upload the add code)

Forbidden. Go to Github and check the Code. The Code has been uploaded successfully.

 

Method 2

You have created a local project and uploaded the project to GitHub.

Document: Xcode uses github to host code

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.