On Thursday, October 4, 2012 11:09:08 AM UTC+2, maxhodges wrote: > Does anyone know a consultant who could help train us a bit on Git? I > thought I understood most of the basics, but something things get very > confusing and we need some help sorting things out. >
I'd say you'd have a higher chance of catching the eye of a consultant or trainer if you provide some more context about your situation, and include contact info. Here are a couple of commercial offerings: - http://training.github.com/ - http://gitorious.com/training For example today we created a new branch and made some commits to it. But > it shows that master is "identical" to this new branch, but in fact it > should be "1 commit behind'. So it's as if whatever we commit to the new > branch is also being committed to the branch called master. Maybe rebase > has something to do with this? I read that rebase can "split" commits > between branches: > http://gitready.com/intermediate/2009/01/31/intro-to-rebase.html > > You're better off staying clear of rebase until you've understood basic branching and merging. I find a great way to study the actual state of the current branches is with 'git log', more specifically with these parameters: git log --graph --oneline --decorate --all (You can configure an alias 'git logtree' for the above command like this: git config alias.logtree "log --graph --oneline --decorate --all" - very handy.) > I'm tempted to just delete my repo and start tracking these files from > scratch because something it no longer makes sense to me. But would be nice > if we can just straighten it out, so I don't have to lose my revision > history. > Just hang in there :) > If I compare "master" and with my new branch ("search-label-issue") it > shows the difference between them (one .css file was changed). So it knows > that are different yet it says they are "identical" (instead of "1 commit > behind") in the SmartGit branch switcher. That's screwed up! > > This "1 commit behind" and "Your branch is ahead of.." output is basically for remote tracked branches. The reason this is shown for remote stuff only is that it is safe to assume that whatever commits you have locally are supposed to be pushed to the respective remote branch. This is not necessarily the case for local branches. If you create a branch "search-label-issue" out from master, it is not necessarily given that the new commits are supposed to be merged back into master. It could be a throw-away experimental branch, a release branch, or whatever. In any case, there would be situations where it would be confusing to output the same "You are behind.." thing as for tracking branches. What you can do instead if you want to compare what's going on between your branches, is to use git logtree like I described above, or more fine-grained commands like: *Show which commits I have in the current local branch since I branched out from master:* git log master.. Or the other way around when I'm on master, and I want to see *what has happened in the branch "search-label-issue"* git log master..search-label-issue Or maybe I want to see *the sum of all changes that have happened in the branch (note the triple dot when using diff):* git diff master...search-label-issue -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To view this discussion on the web visit https://groups.google.com/d/msg/git-users/-/BZNlcGMmoDsJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/git-users?hl=en.
