Git basic usage

Source: Internet
Author: User

# Initialize empty repository git init

# Clone Project to Local
git clone [email protected]:campus2015/training2.git

# New branch and switch to New branch, now this branch is local, Newbranch is the branch name, please name your own branch according to your own needs.
Git checkout-b newbranch

# Switch to your own branch
git checkout Onebranch

# Add files that are not added locally pom.xml
git add pom.xml

# All changes added to the buffer
Git add-a

# submit once, modify into the local repository
Git commit-m ' first commit '

# commit something push to remote branch Newbranch
Git push-u origin Newbranch

# Remote Update Merge to Local
Git push-u origin Haomiao.yang

# Remove Remote Branch Newbranch
git push origin:newbranch (there are spaces between origin and colon)
Git push origin--delete Dev

# View git status
git status

# View Remote Branch
Git branch-avv

Git basic usage

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.