Git uses notes (iii) (illustrations) to illustrate different ways of committing changes, involving code

Source: Internet
Author: User

For work and examples before this step, please refer to the following posts:

    • git use notes (a) Git download and configuration
    • git use notes (ii) How to sync a project on GitHub to a local

------------------------------------------------------------

The following are the commands and relationships involved:

Preparation to be done before submitting:

Add a file to your local project first

Then right click on git Bash here

------------------------------------------------------------------

    • method One: Use the bash operation (step-by): Enter

1. Check if there are any files that are not uploaded locally

git status

possible status One : No changes added to the buffer (no execute add command)

The diagram shows a file that has not been supervised by git (not added to the cache), prompting you to use the git add command, enter as follows, and add all changes to the buffer:

git Add.

If you do not need to add all the files, you can also upload individual files:

Git Add/new file. txt

possible status Two : Cache has been added but not changed (no commit)

The diagram shows that there are changes that can be submitted (a new file) and enter the following code:

file"

possible status three : All changes have been committed to the local repository and can be push to the remote repository

Enter the following code to push to the remote repository: (by default added to the branch of master)

git push

If you want to specify a branch, please refer to another article: Placeholder articles (temporarily no links, pending update)

You need to fill in the GitHub account number and password, please add it yourself.

This opens the GitHub website Project homepage To see that it has been push up

possible status four :P ush complete (local and remote full synchronization)

2. Check if the version is conflicting

Git checkout

3. Select the Upload Branch

Please refer to another article: Placeholder article (temporarily no link, pending update)

4. Submit

Above 1. Contains all the code:

" Add a new file " git push

Results see above.

    • method Two: Use the bash operation (integrated into one step): Enter

git commit-am"Add a new file"

Attached to the Baidu Experience git command Help (there are many options behind commit, you can use git commit-h yourself query):

    • method Three: Use the Git GUI operation (graphical interface):

Right-click the Git GUI from the project folder here

The top-to-bottom functions in the box are:

    • Rescan (checkout or status)
    • The cache change (add command) has a confirmation message, click OK
    • Generate signature (automatically generate a signature/submit message) No submission to the right is impossible.

    • Commit (Commit)
    • Push to remote (push)

When pushing, you can select the branch you want to push, and only show master if you don't have a branch.

The following options explain:

Target repository: remote/Proprietary Warehouse

Transport options: Force overwrite Current branch (may cause change to be lost)/use smaller package (for slow speed)/include tag (label current commit)

Five buttons from top to bottom, click Next again.

Git uses notes (iii) (illustrations) to illustrate different ways of committing changes, involving code

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.