When I was a sophomore, I heard the teacher say that there was a version management tool called Git, which was just listening to the teacher and didn't use it, because at that time, I used SVN and felt that I didn't have much to do with Git.
In recent days, I've been looking at other people's posts in open source China, and I've seen other people on git and GitHub evaluate this platform so much that I downloaded a version of Windows Git bash,
At first, it was impressed by its speed and practicality, so I put git on my virtual CentOS 7, and now I'm mainly using it to help me manage some cumbersome little code, and the charm of a tool like git needs my experience.
Now I'm going to take a note. Under Windows command line, create a local git repository and update to GitHub.
First, we open git bash,
Git bash can download the Windows version from the official Git website.
After we open git bash, we CD G:\gg to the GG folder on the G-disk and create a mkdir command
Test directory, through the LS command to view, the current directory has a test directory
Our CD test enters the test directory .
Initialize the test repository with the git init command.
The . Git file is already in the test directory, and the initialization is successful.
Now we use VIM to create and edit a journal file
Save exit, we pass git status 命令来查看当前 git版本库下的文件状态
At this point, the journal file already exists, enters the non-staged state, and then we use git Add. command to submit the journal file to the staging state,
We see the current file entering the staging state via git status
We use the git commit command to "journal" and complete the formal submission .
At this time we need to fill in the submission requirements, VIM fill save,
The GIT status allows you to see that the file has been formally submitted to git for completion.
Below we create a test repository on the GitHub site and update the local factory library to the Test warehouse.
Click Create,
Create complete
The above two tips will allow us to update to the GitHub repository. The first is that without creating a warehouse, we only need to perform the second operation since we have already created it locally.
The third is to initialize the creation from the existing GitHub repository. Execute the following two statements and enter the user name and password for your GitHub website.
Our diary file was updated to the test repository on GitHub.
Of course we can also initialize the local git repository by cloning the GitHub repository, which is not described here.
In short, with the use of Linux and Windows for the next few days, I learned the charm of the Git and GitHub community, and further realized the power of open source,
Hope that in the future study and life can be more contact with such excellent software.
@author: Karllen
@date: 2014/11/20
Personal Nest: www.karllenfly.com
Windows git bash command line to create a Git repository and update to GitHub