Soft work Practice L exercise one by one using GitHub managed projects

Source: Internet
Author: User
Tags git commands

The theme of this practice is to host projects on GitHub through GIT in a Windows environment. By practicing, basically mastering the use of some GIT commands, registering an account on GitHub and learning to create repositly and organization, try to implement the upload (push), download (clone) function. Here is my summary of the process of this practice.

First, prepare

Download git for Windows and register your account on GitHub.

Second, use the GIT for Windows command line to implement basic functions

Let's introduce some of the more common command-line commands:

PWD: View the path to the current directory.

CD/CD. /CD "directory name": Go back to the root directory (/c/user/administrator)/go back to the top level directory/Enter subdirectories.

mkdir "file name": Create file.

Cat: View the contents of the file.

1), configure the information registered on GitHub.

git config--global "user name"

git config--global "mailbox for registering a GitHub account"


2), create a project into a workspace

First go to the project:


Then execute git init and a git file (hidden file) will appear


The workspace is initially built, and you can start using some git features here.

3), use git add and git commit to add the file to the local master.


4) Upload the ready-to-use project to GitHub's designated repository

First, create a organization on GitHub and create an empty repository with the same name as the repository we are uploading locally.


Then use git push to upload the repository.

Git remote add Origin

Git push-u Origin Master


Finally, refresh GitHub and it's OK.


5), copy repository from GitHub to local

Enter the directory you want to specify first: Cd/g/clone

Then just execute the git clone.


Iii. Summary

In fact, just learn to use git push and git clone will basically be able to master the most important functions. But practice is really a lot of problems, as a rookie, I started to find a tutorial, and then follow his steps, step by step follow him, try to understand the above comments, and finally can come to a more decent results, but often are aware of it, do not know why, if according to his idea is of course very smooth, but , when you want to achieve some of the functions expected to see, you will find the problem one by one, and then often for a puzzling problem to engage in headaches, entanglements. So feel to use the cool words or to spend a lot of energy, or to compare the system to learn more comprehensive, more in-depth study, see one or two tutorials at most can only solve the urgent need, ultimately not a long-term solution.

Four, summary (record some of the more commonly used GIT commands, convenient for later query)

Git init create workspace

git add "file"

git commit-m "comment" submitted to master Branch

Git Status View current status

git log View history

git reset--hard head~ "version number" restores a historical version

Git checkout--"file" revocation

Git remote add Origin URL

Git push-u Origin Master (as soon as GIT push Origin master is available)

git clone URL

git config--global "user name"

git config--global "mailbox for registering a GitHub account"

Hello World code Base: Https://

Recommend a more detailed tutorial:

Soft work Practice L exercise one by one using GitHub managed projects

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: 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.