Git usage-level information

Source: Internet
Author: User
Tags git workflow using git

I was so excited to configure the development environment today. I opened git -- clone and modified the code pull push. It seems that the file has not been updated successfully and the page has not changed, then I kept pull over there for pull, push for push, and the results still did not solve the problem. Finally, I found that using git to manage images is really different from the code. You can manage images in three ways. Clone \ pull \ push, but the Code does not seem that simple.

I found some information in the garden and sorted it out.

Disadvantages of git:Full-blown Abstraction

Git contains too many non-Abstract abstractions, and there is often no difference between defining user interfaces and implementations. This is understandable. For an advanced user, he needs to understand the specific implementation of some functions, to understand the nuances of each command. However, a large number of internal details are a nightmare for beginners. There is a saying that for plumbing equipment and porcelain, you must be a plumber to know how the equipment is installed on porcelain.

Many people have responded to my complaint: You don't need to use all the commands. You can use git like subversion. This is a sophistry, just like telling a grandmother that the highway is not terrible. She can crawl 20 kilometers per hour in the fast lane on the left. Git does not provide any useful subsets. Each Command is associated with requirements for other commands. Simple actions often require complex actions to be undone or improved.

Below are some good suggestions from a GitHub project maintainer:

1. Search for the merged benchmark on the branch and master: 'git merge-Base Master yourbranch'

2. Assume that you have submitted a change record, from rebenchmarking your submission to merging accuracy, and then creating a new branch

3. Git rebase-onto <basecommit> head ~ 1 Head

4. Git checkout-B My-New-branch

5. Check out your ruggedisation branch and then remove the commit: 'git reset-hard head ~ 1 ′

6. Merge new branches to ruggedisation: 'git Merge My-New-branch'

7. check out the master ('git checkout master'), merge the new branch ('git Merge My-New-branch'), and then check the merged status, then remove the Merge ('git reset-hard head ~ 1 ′).

8. submit a new branch ('git push origin my-New-branch') and record the pull request

Grandma, it's easy to drive on the highway. Loosen the clutch, let the speed exceed 6000 turn to make the wheel slide, then enter the first bend and go to the highway, look at the road signs to the exit, use the handbrake to shift to the exit.

Disadvantages of git:Simple tasks require many commands.

If you are developing an open-source project, you have made some changes and want to share it with others, you only need:

1. modify the code

2. Run SVN commit.

If you add some new files:

1. Add a file

2. SVN add

3. SVN commit

If your project is hosted on a GitHub website, you need:

1. Make some changes

2. Git add [not to be confused with SVN add]

3. Git commit

4. Git push

5. so far, your changes are only half done. Next you need to log on to GitHub, find your submission, and then release a "pull request" so that other people can get your changes.

In reality, the GitHub maintainers want your changes to be functional branches and they will require you to perform the following operations:

1. Git checkout master [to make sure each new feature starts from the baseline]

2. Git checkout-B newfeature

3. Make some changes

4. Git add [not to be confused with SVN add]

5. Git commit

6. Git push

7. log on to GitHub, switch to your new feature branch, and release the "pull request"

To move your changes from your local directory to the actual project resource library, you need to: add, commit, push, "click pull request", pull, merge, and push.

The following is a flowchart to show you what a typical developer is doing on Subversion:

"Bread and butter" is a command and concept used to operate on remote SVN databases.

Then let's take a look at what will happen if your project is hosted on GitHub:

If git is powerful in branch and merge, its weakness is to make simple tasks very complex.

10 reasons I hate git English version: 10 things I hate about GIT)

  Other sharing materials

  • Ruan Yifeng: git branch management policy
  • Five basic differences between git and SVN
  • Understand Git workflow
  • More Git-related news
  • Git instructions image version, click to view the big image (picture source network)

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.