Calgarypuck Forums - The Unofficial Calgary Flames Fan Community
Old 09-05-2019, 02:25 PM   #1
FanIn80
GOAT!
 
FanIn80's Avatar
 
Join Date: Jun 2006
Exp:
Default "Gitting" Git

I'm almost 25 years into a career on the network side of IT. I've done the whole spectrum. Junior, Intermediate, Senior, Management. Support, Deployment, Design... Literally almost 25 years of hands-on, practical experience at all levels of SMB IT.

Last December, I decided to switch gears and now I'm four months into my first job as a software developer, and if there is one thing that routinely makes me feel like I've never even seen a computer before, it's Git.

I can use Git on my own just fine. I "git" it, if you will. Using Git as part of a team though is a completely different animal. At least, it feels like that to me anyway.

Perfect example... they tell me today that Git has been cleaned up and merged and that now all branches are up to date and broken off properly, etc. I'm like ok... so I do a fresh pull off origin/develop, make a change to something and push back to origin/develop, and now when I go online to see my commit in Bitbucket, I see all the other branches merging into a single point, but now there's my commit extending the develop branch from the last time someone updated it a week ago, but it's standing on its own looking like it contains none of the code that was supposedly merged back into it...

Look at this (develop branch is green). When I looked before I pulled from develop, it was just the one single point where everything was merged (the commit before the latest one). After I pushed, it looks like my codebase doesn't have any of the changes that were done on the other branches from between the last develop commit and my recent develop commit.

Spoiler!


What am I not understanding? I'm asking people, how come it looks like none of our recent work is part of the develop branch? Like I know we did a bunch of emergency work on the release branch, but that's over and now where back to working on develop again, so how come it looks like nothing from release or master is part of develop? Do we merge master into develop now to get develop up to date?... and they're like, dude you don't merge master into anything... you merge stuff into master...

Git is literally my arch-rival at this point.

Last edited by FanIn80; 09-05-2019 at 02:27 PM.
FanIn80 is offline   Reply With Quote
Old 09-05-2019, 03:51 PM   #2
FlamesPuck12
First Line Centre
 
Join Date: Apr 2007
Exp:
Default

Based on the tree that you posted, it looks like there are 2 commits that are different on the develop branch (compared to the orange branch). You said you created the latest commit on green but someone else created the first green commit? Is that first green commit a new feature commit or is that the clean up commit (perhaps squashed commit of the tree on the left)?

Unless that green commit is equivalent to the orange and blue tree on the left, it looks like your develop branch does not contain everything on orange/blue tree.

You could potentially merge those into the develop branch but I would prefer to rebase the 2 green commits on top of the orange and reset the develop branch to that.
FlamesPuck12 is offline   Reply With Quote
The Following User Says Thank You to FlamesPuck12 For This Useful Post:
Old 09-05-2019, 04:14 PM   #3
FanIn80
GOAT!
 
FanIn80's Avatar
 
Join Date: Jun 2006
Exp:
Default

Quote:
Originally Posted by FlamesPuck12 View Post
Based on the tree that you posted, it looks like there are 2 commits that are different on the develop branch (compared to the orange branch). You said you created the latest commit on green but someone else created the first green commit? Is that first green commit a new feature commit or is that the clean up commit (perhaps squashed commit of the tree on the left)?

Unless that green commit is equivalent to the orange and blue tree on the left, it looks like your develop branch does not contain everything on orange/blue tree.

You could potentially merge those into the develop branch but I would prefer to rebase the 2 green commits on top of the orange and reset the develop branch to that.
So it turns out that I was right in noticing the develop branch wasn’t actually up to date (they thought it was up until I pushed to it and showed them). So I’m at least relieved that I’m not completely on a different planet with this stuff.

The part I need to work on is my approach to fixing it. I was suggesting all these crazy merge scenarios, and I never once thought of a rebase.

Last edited by FanIn80; 09-05-2019 at 04:17 PM.
FanIn80 is offline   Reply With Quote
Old 09-05-2019, 08:04 PM   #4
photon
The new goggles also do nothing.
 
photon's Avatar
 
Join Date: Oct 2001
Location: Calgary
Exp:
Default

Yeah rebasing is one of the really powerful things in Git but one of the things that takes a while to really get, at least that's been our experience with people new to Git. They treat it like Subversion++.

The other quirk that seems to throw people is the idea of an origin.. that there's the develop branch on your local repo and the develop branch on the origin (Bitbucket in your case) and that those can be different.

I still tend to use GUIs like SourceTree just because I like the visual representation of all the branches, the immediate view of if my local branch is in sync with the remote, etc.
__________________
Uncertainty is an uncomfortable position.
But certainty is an absurd one.
photon is offline   Reply With Quote
Old 09-06-2019, 12:21 PM   #5
Bobblehead
Franchise Player
 
Bobblehead's Avatar
 
Join Date: Jul 2005
Location: in your blind spot.
Exp:
Default

Git continually confuses me. And yes, I'm coming from a VSS/Subversion background. Just difficult to wrap my head around. When things are going smoothly, its fine. But something gets out of whack and I can spend hours trying to get everything merged correctly.

Right now I do everything CLI (bash), which is fine but tedious. I need to look at some free GUI to better manage it.

I can see the power and utility of GIT, but it is anything but intuitive.
__________________
"The problem with any ideology is that it gives the answer before you look at the evidence."
—Bill Clinton
"The greatest obstacle to discovery is not ignorance--it is the illusion of knowledge."
—Daniel J. Boorstin, historian, former Librarian of Congress
"But the Senator, while insisting he was not intoxicated, could not explain his nudity"
—WKRP in Cincinatti
Bobblehead is offline   Reply With Quote
Old 09-06-2019, 05:45 PM   #6
FanIn80
GOAT!
 
FanIn80's Avatar
 
Join Date: Jun 2006
Exp:
Default

I have SourceTree, but I find I prefer just using shell commands instead. The GUI representation is overwhelming at times, and the lingo is not super intuitive. At least to me, anyway.
FanIn80 is offline   Reply With Quote
Old 09-09-2019, 01:52 PM   #7
kermitology
It's not easy being green!
 
kermitology's Avatar
 
Join Date: Oct 2001
Location: In the tubes to Vancouver Island
Exp:
Default

If there was a piece of technology that I could hug, it would be Git.

You failed to actually pull the changes in. So you might have done a fetch, but didn't actually pull in those commits. A simple: `$ git rebase` will probably fix it.

I personally think that learning git from the command line will help you better understand what git is doing.
__________________
Who is in charge of this product and why haven't they been fired yet?
kermitology is offline   Reply With Quote
Old 09-09-2019, 03:12 PM   #8
FanIn80
GOAT!
 
FanIn80's Avatar
 
Join Date: Jun 2006
Exp:
Default

Quote:
Originally Posted by kermitology View Post
If there was a piece of technology that I could hug, it would be Git.

You failed to actually pull the changes in. So you might have done a fetch, but didn't actually pull in those commits. A simple: `$ git rebase` will probably fix it.

I personally think that learning git from the command line will help you better understand what git is doing.
No I literally did git pull origin/develop. When I was done, I did git push origin/develop. They later confirmed that the changes from the release branch weren't actually merged back into the develop branch like they were supposed to have been.
FanIn80 is offline   Reply With Quote
Old 09-09-2019, 03:19 PM   #9
kermitology
It's not easy being green!
 
kermitology's Avatar
 
Join Date: Oct 2001
Location: In the tubes to Vancouver Island
Exp:
Default

If you did a pull, then a commit, then a push you should be in line. You could have done a pull and had a conflict which didn't actually apply the changes. Also, this could be SourceTree messing with things.

If you had a clean repo, did a pull and then made your commit there's no way you would have this bubble. Your local head did not have the remote changes.
__________________
Who is in charge of this product and why haven't they been fired yet?
kermitology is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 12:53 PM.

Calgary Flames
2023-24




Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright Calgarypuck 2021