简体   繁体   中英

How do I get my git commit history back to normal?

I work on my local 'master' branch and then periodically jump over to my 'release' branch and type

% git merge master

And that was working just fine for quite a while--in my commit history on BitBucket, I'd see checkins to mainline followed by a merge to release. But now when I merge and push to origin/release, I just see the commits--they don't look like a merge at all. Apparently, I know just enough to be dangerous because I can't figure out what I did to mess things up.

I'm not even sure how to Google this problem, so even a RTFM response with a URL would be appreciated.

Here's what my master branch looks like. What is going on here?

* 0a41d90 
*   77127c8 
|\  
| * a9e803b 
| * 76bf8dd 
| *   03f6c4d 
| |\  
| * \   fffbcab 
| |\ \  
| * \ \   7e1064f 
| |\ \ \  
| * \ \ \   155b815 
| |\ \ \ \  
| * | | | | 6990b2f 
| * | | | |   6fc18fd 
| |\ \ \ \ \  
| * \ \ \ \ \   8b63f1b 
| |\ \ \ \ \ \  
| * \ \ \ \ \ \   feddf35 
| |\ \ \ \ \ \ \  
| * \ \ \ \ \ \ \   8eeedd4 
| |\ \ \ \ \ \ \ \  
| * \ \ \ \ \ \ \ \   f4bc862 
| |\ \ \ \ \ \ \ \ \  
| * \ \ \ \ \ \ \ \ \   6595d3b 
| |\ \ \ \ \ \ \ \ \ \  
| * \ \ \ \ \ \ \ \ \ \   245ea26 
| |\ \ \ \ \ \ \ \ \ \ \  
| * \ \ \ \ \ \ \ \ \ \ \   895733b 
| |\ \ \ \ \ \ \ \ \ \ \ \  
| * \ \ \ \ \ \ \ \ \ \ \ \   fa22b61 
| |\ \ \ \ \ \ \ \ \ \ \ \ \  
| * | | | | | | | | | | | | | d56755e 
| * | | | | | | | | | | | | |   1afb89d 
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \  
| * \ \ \ \ \ \ \ \ \ \ \ \ \ \   9ef936c 
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \  
| * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \   77adbee 
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  
| * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \   d37e67d 
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  
| * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \   7e7e8fa 
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  
| * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \   3cebafd 
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  
| * \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \   67327ce 
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  
| * | | | | | | | | | | | | | | | | | | | | 2ddd17c 
| * | | | | | | | | | | | | | | | | | | | | 51d241f 
* | | | | | | | | | | | | | | | | | | | | | acf8dd7 
* | | | | | | | | | | | | | | | | | | | | | 238ba1c 
| |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|/  
|/| | | | | | | | | | | | | | | | | | | |   
* | | | | | | | | | | | | | | | | | | | | b2987cf 
| |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|/  
|/| | | | | | | | | | | | | | | | | | |   
* | | | | | | | | | | | | | | | | | | | 60c1528 
| |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|/  
|/| | | | | | | | | | | | | | | | | |   
* | | | | | | | | | | | | | | | | | | fa4152b 
| |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|/  
|/| | | | | | | | | | | | | | | | |   
* | | | | | | | | | | | | | | | | | 35f3451 
* | | | | | | | | | | | | | | | | | 929990d 
* | | | | | | | | | | | | | | | | | 52d07ac 
* | | | | | | | | | | | | | | | | | 0b010f8 
| |_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|/  
|/| | | | | | | | | | | | | | | |   
* | | | | | | | | | | | | | | | | 38bdc49 
* | | | | | | | | | | | | | | | | 67e2693 
* | | | | | | | | | | | | | | | | d98cc92 
* | | | | | | | | | | | | | | | | 8f35a00 
* | | | | | | | | | | | | | | | | cac033c 
| |_|_|_|_|_|_|_|_|_|_|_|_|_|_|/  
|/| | | | | | | | | | | | | | |   
* | | | | | | | | | | | | | | | d7ebb20 
| |_|_|_|_|_|_|_|_|_|_|_|_|_|/  
|/| | | | | | | | | | | | | |   
* | | | | | | | | | | | | | | 2a3b53f 
* | | | | | | | | | | | | | | 937080c 
* | | | | | | | | | | | | | | 3a925b8 
* | | | | | | | | | | | | | | f5b757b 
* | | | | | | | | | | | | | | 398daad 
| |_|_|_|_|_|_|_|_|_|_|_|_|/  
|/| | | | | | | | | | | | |   
* | | | | | | | | | | | | | 42f3300 
| |_|_|_|_|_|_|_|_|_|_|_|/  
|/| | | | | | | | | | | |   
* | | | | | | | | | | | | eb455d7 
| |_|_|_|_|_|_|_|_|_|_|/  
|/| | | | | | | | | | |   
* | | | | | | | | | | | dc7db8a 
| |_|_|_|_|_|_|_|_|_|/  
|/| | | | | | | | | |   
* | | | | | | | | | | 0f09b40 
| |_|_|_|_|_|_|_|_|/  
|/| | | | | | | | |   
* | | | | | | | | | 7c1271e 
* | | | | | | | | | e9a9582 
* | | | | | | | | | 92fa1dd 
* | | | | | | | | | fb0a0c2 
* | | | | | | | | | 2a6bccf 
| |_|_|_|_|_|_|_|/  
|/| | | | | | | |   
* | | | | | | | | b1cc90f 
* | | | | | | | | 2215950 
* | | | | | | | | 26e1f4e 
| |_|_|_|_|_|_|/  
|/| | | | | | |   
* | | | | | | | bde1089 
* | | | | | | | 39b7af7 
* | | | | | | | 7626f37 
* | | | | | | | 152a71e 
* | | | | | | | 01a8351 
* | | | | | | | 5455aad 
* | | | | | | | 5c3a2e4 
* | | | | | | | e003d70 
| |_|_|_|_|_|/  
|/| | | | | |   
* | | | | | | 2494a37 
| |_|_|_|_|/  
|/| | | | |   
* | | | | | 7fa4f9d 
* | | | | | 98781b0 
| |_|_|_|/  
|/| | | |   
* | | | | 85047a2 
* | | | | b81af73 
* | | | | cfbf163 
| |_|_|/  
|/| | |   
* | | | f4ce570 
| |_|/  
|/| |   
* | | 7124029 
| |/  
|/|   
* | 86e30a9 
* | b8609a7 
* | b7ebd85 
* | effb05a 
* | c2511fa 
* | 154eaf3 
* | 9aaf759 
* | 8d57e05 
* | 56bc946 
* | 4e46bfb 
* | 9ee3c38 
* | 8f3bec0
|/  
* 5e4e6e0 
* f122342

If there were no commits on your release branch, then each merge of master into release would be a fast-forward merge (just advances the branch label along the "line" and does not create a new "line").

At some point you committed 51d241f and 2ddd17c to your release branch. From that point on (starting with commit 7124029 on master ), every time you committed to master and then merged master into release , a fast-forward merge wasn't possible, so you created another "line" in your graph to record the merge.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM