Git (Attack learning: Remote warehouse operation)-v3.0

Source: Internet
Author: User
Tags git mergetool

1. View the current remote repository :git remote or git remote-v

2. Add a remote repository : Git remote add [shortname] [url]

  Git remote add PB git//github.com/pa/tic.git

You can now use the string PB to refer to the corresponding warehouse address.

3. View Remote Repository information : Git remote show [remote-name]

  git remote show origin

4. Push data to remote repository : git push [remote-name] [Branch-name]

Git push Origin Master

5. Fetching data from a remote repository : git fetch [remote-name]

Git fetch origin

6. Deletion and renaming of remote repositories

Rename: Git remote rename

Delete: Git remote rm [short_name]

Git tips:

Auto-complete function:

With Msysgit installed on Windows, the default Git Bash is already well-equipped with this auto-complete script that can be used directly

When you enter a Git command, you can hit the tab two times, and you'll see a list of all the available command suggestions that match:

git co<tab><tab> commit config



7. Create a fraction and enter the branch

git checkout-b ' branch name '

8.gie Branch Merge

git merge ' branch name '

9. Resolving Branch Merge conflicts

Git mergetool

It invokes a visual merge tool and guides you through all conflicts

10. There is no use after the branch merge, we delete it immediately.

Git branch-d Hotfix

11. Manage branches to see which branches

Git branch

12. To view information about the last commit object for each branch , run git branch-v

Git branch--no-merged view not merged branch

Git branch--merge see which branches have been merged into the current branch

13. One local git repository with two- way Warehouse

[Email protected]

[Email protected]

Use Git remote-v to see what remote repositories are in the local repository, and if there is only one then add one, and give the remote repository an individual name, named another.

14. Push the local branch to the remote repository

git branch changegruntfilegit checkout changegruntfilegit push another changegruntfile

**2100% (19/19), done. Writing objects:100% (25/25), 3.42 KiB | 0 bytes/(Delta 2), reused 0 (Delta 0) to [email protected]:zqzjszqzjs/grunt.git * [New Branch ]      changegruntfile- changegruntfile* *

Last hint * [new branch] Changegruntfile-Changegruntfile A new branch, we're going to the remote repository to see:

15. Delete the remote repository branch :

git push another:changegruntfile //NOTE: There are spaces in front of ': ' Here git push [remote name] [local branch]:[remote branch] syntax, if the ' local branch ' is omitted, then it is said to "extract the blanks here and turn it into [远程分支] ".

Git (Attack learning: Remote warehouse operation)-v3.0

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.