Common Git Commands

Source: Internet
Author: User

1. Git init
2. Git status
3. Git add octocat.txt
git rm--cached file_name
4. Git commit-m "Add cute octocat story"
5. Git add ' *.txt '
6. Git log
7. Git remote Add Origin https://github.com/try-git/try_git.git
8. Git push-u Origin Master

The name of our remote are origin and the default local branch name is master. The-u tells Git to remember the parameters, so, next time we can simply run Git push and git would know what to do.

9. Git Pull Origin Master
Ten. Git diff HEAD
one. Git diff--staged
git reset Octofamily/octodog.txt
Git checkout--octocat.txt
Git branch clean_up
. Git checkout Clean_upgit

branch-d git clean_up

Delete the Branch

. Git push

BTW:

The filtered content in the. gitignore file cannot be quoted

Common Git Commands

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.