Use the GIT command window to submit a local project to a remote github

Source: Internet
Author: User

Goal:

1. The problem is how to submit a local project to GitHub via the git command window.

2. Convenient for the park friends at the same time also facilitate their own later to solve such problems.

Steps:

1. First login to GitHub website https://github.com/

2. New Repository

    

3. New Ticketbrushsystem repository, where the red box can be filled out according to the actual situation.

    

The following interface will appear when successful

4. Clone Ticketbrushsystem to local 4.1. Use git bash to switch the working directory to the local project directory, for example, the author's project is located under F:\\01_code\\01_eclipse\\ticketbrushsystem 4.2. Clone the GitHub repository to local using the git clone command. First copy the path of the newly created repository on GitHub as shown in the author's ticketbrushsystem path, Https://github.com/leesf/TicketBrushSystem.git 4.3. Using commands git clone https://github.com/leesf/TicketBrushSystem.git clone Ticketbrushsystem to Local

      

4.4. After cloning is complete, use the Ls-al command to view the current directory structure

      

You can find the directory before the catalog, much more./、.. /and Ticketbrushsystem directory, where./indicates the current directory,.. /indicates the previous level of the directory

Ticketbrushsystem represents the directory we cloned from GitHub and went into the Ticketbrushsystem directory to view the files.

      

4.5. Move the files in the Ticketbrushsystem directory to the previous level directory and delete the Ticketbrushsystem directory.

Can be done via the MV command, such as MV./.git/./readme.md. /means to put the. git file in the current directory

and readme.md files to the previous directory, and then use the Ls-al command to view the directory discovery was actually moved.

As shown
      

Switch to the previous level directory, use Ls-al to view the catalog files, and discover that the. git and readme.md files in the Ticketbrushsystem directory have moved the current directory.

As shown

      

Use the RM command to delete the Ticketbrushsystem directory, such as RM-RF./ticketbrushsystem, which represents recursion and does not give the prompt to delete the Ticketbrushsystem directory file,

Delete all files under the Ticketbrushsystem directory, as shown in

      

5. Submit your code to remote GitHub

5.1. Use git Add. command to add all files to version control, as shown in

    

5.2. Use the git commit-m "first commit" command to perform a local commit operation, as shown in

    

5.3. Use the GIT push Origin master command to synchronize the submitted content to only the remote repository GitHub, as shown in

    

You need to enter your username and password when synchronizing, just enter our github username and password to complete the synchronization process.

5.4. Refresh our GitHub homepage to display the files we have synced, as shown in

    

The five steps above basically complete the process of submitting the local project to a remote github. However, obviously this is not very good, because others do not know what the project does, so it is time to edit the readme.md file for other users to understand the role and significance of the project.

6. Edit the Readme.md file

The readme.md suffix named. MD,MD is the abbreviation for markdown, and Markdown is a language for editing blogs. You need to use labels for typography, and if you just edit the text, you'll have a very unsightly effect. About GitHub's readme.md files can also be a tutorial series, want to learn more about the park friends can go to the information, I at the end of the article also gave a learning link. Now we're only going to finish writing the simplest readme.

6.1. edit the Readme.md file as shown in

    

6.2. Edit the content as shown

    

6.3. After submission as shown

     

Combined with the above six steps to complete the entire project to complete the submission.

Summarize:

Good memory is better than bad writing, the advantage of recording is convenient for others, but also convenient for themselves. I hope this note will be helpful to the needs of the park friends, but also thank you for the views of the park friends.

Reference Links:

README.MD Tutorial: http://blog.csdn.net/kaitiren/article/details/38513715

Use the GIT command window to submit a local project to a remote github

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.