Create a Git repository under the Windows git Bash command line and update it to github, gitgithub

Source: Internet
Author: User

Create a Git repository under the Windows git Bash command line and update it to github, gitgithub

 

When I was in my sophomore year, I heard the teacher say that there was a version management tool called git. At that time, I only listened to the teacher and didn't use it because I used svn, I feel that I don't have much to do with git.

In the past few days, I have often read other people's posts in open-source China. I have seen many people comment on git and github platforms, So I downloaded a windows version of git bash,

I was impressed by its speed and utility at the beginning, so I installed git on my virtual Centos 7. Now I mainly use it to help me manage some tedious little code, the charm of tools such as git still needs to be realized.

Now I will record how to create a local git repository under the Windows Command Line and update it to github.

First, open git bash,

Git bash can be downloaded from the official git website for Windows.

After opening git bash, weCd G: \ ggGo to the G drive's gg folderMkdirCommand to create

Test directory, throughLsCommand to view, the current directory already hasTest directory

 

WeCd testEnterTest directory.

 

PassGit initCommand to initialize the test repository.

In this case, the test directory already exists.. GitFile, initialized

 

Now we use vim to create and editDiaryFile

 

Save and exit.git status Command to view the File status in the current git version Library

 

 

At this time, the log file already exists and enters the unsaved state. Then we useGit add.Command to submit the "Diary" file to the temporary storage status,

 

We can see that the current file entersTemporary storage status

We passGit commitRun the "log" command to completeFormal submission.

At this time, we need to fill in the submission requirements, vim fill in and save,

 

 

In this case, you can see that the file has been officially submitted to git through git status.

 

Next we will create a Test repository on the github website and update the local factory repository to the Test repository.

 

 

Click create,

 

Created

 

 

The above two tips allow us to update to the github repository. The first is that, without creating a repository, we only need to perform the second operation because we have already created a repository locally.

The third is to initialize and create from an existing github repository. Run the following two statements and enterUsername and password,

 

 

Our diary file is updated to the Test repository in github.

 

Of course, we can also use the clone github repository method to initialize the local git factory library, which is not described here.

In short, I learned the charm of git and github communities through the use of Linux and Windows over the next few days, and further realized the power of open source,

I hope to have more contact with such excellent software in my future study and life.

@ Author: karllen

@ Date: 2014/11/20

Personal nest: www.karllenfly.com

 

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.