Common git commands and scenarios (I)-Online code update and project code submission

Source: Internet
Author: User
Tags git commands

Git was used in recent work and a simple record was made:

1. project view or execution for test environment and online environment: git initialization: git initgit pull code: git pull git@127.0.0.1: Project. git 2. project development, used in the development environment: (After development on the basis of 1) First, a configuration is involved in code submission. The configuration content is to mark the user who submitted the code modification, you need to set the parameters "name" and "email" by running the following command: git config -- global user. name "lixinglei" Git
Config -- global user. Email "lixinglei@xxxx.com"
After the configuration, you can view it through git config -- list:
[Lixinglei @ bogon ~] $ Git config -- listuser. Name = lixingleiuser. Email = lixinglei@xxxx.com

The configuration change belongs to the user-level (global) configuration. After the configuration is complete, all git repository submissions use this name and email

View the current changes. It is usually used before commit to confirm that git status is more advanced than git status. view the specific changes: git diff (if a new file is added: git add file1.py if any file is deleted: git RM file2.py) after the code is confirmed to be correct, the code is submitted. The commit is committed to the local machine: git commit file3.py service/file4.py-M "version note" before pushing the local code to the server, you usually need to update the online code. This pull operation will automatically merge the local merge code: git pull git@127.0.0.1: Project. git
Finally, the local library code is pushed to the server: git push git@127.0.0.1: Project. Git

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.