git command usage Tang Jiawei

Source: Internet
Author: User

My team and I used git for code management in my previous college practice and Li Youmeng Teacher's class. But all use a visualization tool, Sourcetree.

In this tool, there is no need to tap the git command, it is all a visual interface. This is my first time to touch git commands and I need to learn more.

After you've installed Git on your desktop, right-click on the desktop, choose Git Bash here, and enter the following command.

At this point, the initialization process is completed and a warehouse is generated.

Then edit, compile, and run the helloworld.cpp.

Set your own user name and mailbox on the command line.

Then add the code to the staging area, and then use commit to go to the local repository.

The log command is used to query the version history.

Create a new repository under the GitHub account, HelloWorld.

Use the command line to try to get SSH key.

Import the acquired SSH key into GitHub.

Connect to the remote cloud Library and upload the local warehouse files to the server side.

Where the code is exactly the same.

Compare fetch and pull

Make changes to the code.

A total of two versions are submitted at this time!

Use the FETCH command.

Generated two branches, remote branches and local branches. The code for the remote branch is more ancient, and the local branch code has been modified!

The temp temporary branch merge was used successfully.

Clone command.

git command usage Tang Jiawei

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.