Recently learned Git rebase, feel very cool appearance,It turned out to be a slap in the face today.
Git pull--rebase
Error:
Cannot rebase:you have unstaged changes please
commit or stash them.
The first reaction is:No. Can Yes. Just now it was clearly submitted. How can there be changes. Hysterical.
Finally with
Git merge generates a new merged node, and Rebase does not
Like what:
D---E test
/
A---B---C---F master
Merge using Merge:
D--------E
/ \
A---B---C---F----G test, Master
And the use of rebase:
A---B---D---E---C '---F ' test, Master
When you use Git pull, the default is merg
1, with the branch pull to use:
Git pull--rebase
2, different branches of the combination:
# # Local Machine(develop) $: Git pull origin develop--rebase# # Switch to feature branch, Yan develop branch, if there is conflict, resolve conflict after continue, commit again(develop) $:
Most technology companies, when using Git to manage code, often ask for the format of the commit message, which is not in the right format. It is also a technical job to find and modify the error message, and I have no less to lose in this respect, and now I share my experience with you:
/Modify History Submission InformationGit rebase-i head~3 (this number 3 is just for example, you can give any)When this
Develop_newfeature_authorcheck branch modification directly down to the local code merge and produce a commit, the merge commit.You can use Git pull–rebase this ending is completely different. -rebase does not produce a commit commit, but instead appends your e commit to the end of D commit. When you look at commit log, there is no more commit that you don't kno
not affect other people's work.In fact, the above is the rebase and merge different application scenarios.In the case of scenario 1, if you modify a bug in a common code, this is the time to put all the OEM version branches rebase to the branch to fix the bug, in the rebase process, Git will ask you to manually resolv
Using Rebase-i will present an interactive page at the terminal. In this interactive page we can make certain changes to the commit to be rebase.UsageGit rebase-i Put the commit of the current branch behind DiscussMost developers like to use Rebase-i to polish our feature branch while the merge branch is in master. He gave us the chance to merge some commits, del
We often encounter conflicts when using git rebase, pull, and push. At this time, we will go to merge:
$ git rebase master
Conflict:
$ git mergetool -t opendiff
Then, use opendiff to manually merge the conflicting location.
However, today I met a situation where merge is
Recently, when learning about Git, there was a question, if two people commit the code, how does this keep the code consistent?For example, a now commits the code and then succeeds in pushing the code to the server side. But the B commit code can, but push to the server will be error? Because this time the server has a new commit, swollen?The solution is as follows: (This piece of wood is operated using the command line, using the Turtle (Tortoise))1.
: Git status View changes to files in the local workspace, registers
For the use of Git diff and git add commands, please refer to the article: Git Usage manual: Git diff, git Add, git
Git basic tutorial
The following is actually a basic tutorial for Git use within the company. I will record it here.
Modify Git configurationsWindows operating system line feed Configuration
git config --global core.autocrlf inp
manual: Git diff, git Add, git diff--cached command details
For a detailed explanation of git commit commands, please refer to the article: Git manual: Git commit-m/-am/-a-m submit files to local warehouse area
For a
: Git status View changes to files in the local workspace, registers
For the use of Git diff and git add commands, please refer to the article: Git Usage manual: Git diff, git Add, git
I first published and summed up the things I learned, there are bad places please point out
one, git upload item (install git)
There are two ways git uploads a project: An HTTPS method, an SSH method
HTTPS method:
1, first login github.com registered account to create a newrespository
2, install git,
1. Git commit–amendIf you just want to modify the commit you just submitted (the last commit), you can use to git commit --amend modify the last commit. Use this command to pop up a dialog box (under Windows) or the Vim editing interface (under Linux). In the pop-up interface to make changes, save can be submitted with the new submission information. This command can only modify the submission memo informat
Git is a simple getting started tutorial. It is a simple tutorial for students who have never dared to use Git.
It has been almost half a year since I started to work in February 12, 2014. I still remember the surprise when I first came into contact with the centralized version control tool SVN. This is for me who have
Concise git tutorial (single-user version) and git tutorial
Recently, I started to write a relatively large project, so I need to use git. I have been using SVN built with Kingsoft kubernetes and turtles. Recently I want to try git
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.