Common git commands

Source: Internet
Author: User

1. Cloning a project to a local

git clone [email protected]:xxx/xxx.git
Or
git clone https://git.oschina.net/xxx/xxx.git

2. View local Branch

Git branch

* br-2.1.2.2

Master

3. View all branches (including remote)

Git branch-a  * br-2.1.2.2    master    remotes/origin/head-Origin/master    remotes/origin/br-2.1.2.1    remotes/origin/br-2.1.2.2    remotes/origin/br-2.1.3    remotes/origin/master

4. Create a branch

Git branch dev_mastergit Branch  * br-2.1.2.2    Master    

5. Switch branches

git checkout dev_mastergit branch* dev_master  br-2.1.2.2  Master

6. Push the branch to the remote branch

Git push Origin Dev_master

7. Delete local Branch

Git branch-d dev_master

8. Delete Remote Branch

< Branchname >

Or
Git push Origin:<branchname>

9. Get the remote tag

< tagname >

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.