Re: [git-users] Re: how to to check if a branch has changes not present in master?
git diff master.. Would give you what's in your current branch since master git diff ..master Would show you commits in master that your local branch doesn't have git diff ...master Or git diff master... Would show you all commits that your branch and master do not share I only find the 3 dot version useful for identifying that two branches are entirely equal. On Aug 28, 2012, at 6:28 AM, Aneesh Bhasin contact.ane...@gmail.com wrote: Hi.. On Tue, Aug 28, 2012 at 6:02 PM, Fred fredgarlo...@gmail.com wrote: On Tuesday, August 28, 2012 1:15:08 PM UTC+2, Tim Chase wrote: On 08/28/12 05:47, Tim Chase wrote: On 08/28/12 03:13, Fred wrote: is there a way to check if a branch doesn't introduce changes, which are not in master. I'm partial to git diff my_branch ^master which would find all the changes on my_branch that aren't yet on master. This is an open syntax so you can request changes that are on my_branch_a, but aren't on master or on my_branch_b with git diff my_branch_a ^my_branch_b ^master Additionally, I find the diff version somewhat hard to read unless the delta is small, but the same syntax works for log: git log my_branch ^master ^my_branch_b which can give you a higher level view of the changes. Hm. Maybe I've explained it wrong way. Let's say, my_branch is in sync with master I do commit in master, so the master is ahead of my_branch by one commit. git diff my_branch ^master would show a diff for this last commit and that is not what I want. In that case it is ok master differs from my_branch. What I want to detect is following: my_branch is in sync with master. Then there are some or none commits in master and one commit into my_branch. I want identify the commit into my_branch, because the change is not in master Thanks for help! wouldn't 'git diff master...my_branch' (note three dots instead of two) give what you want (or maybe its the other way round) ? regards, Aneesh -- You received this message because you are subscribed to the Google Groups Git for human beings group. To post to this group, send email to git-users@googlegroups.com. To unsubscribe from this group, send email to git-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/git-users?hl=en. -- You received this message because you are subscribed to the Google Groups Git for human beings group. To post to this group, send email to git-users@googlegroups.com. To unsubscribe from this group, send email to git-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/git-users?hl=en.
Re: [git-users] applying and un-applying the same commit
git is not the problem your pattern is. isolate your configuration into as few files as possible. commit a template for that file(s). (so that new devs can copy it into place and edit it once) then add the real file to the .gitignore so that it isn't tracked. Now if you want to get fancy use your deployment tool to upload the correct template or build it on the fly for each system you expect to deploy to. On Fri, Nov 12, 2010 at 11:59 AM, ruud r.grosm...@gmail.com wrote: hi group, I am very happy to have left rcs, cvs and subversion behind me and have adopted git. However, I am not so fluent with it as I used to be with CVS. git has a lot of commands and options I don't use. Hopefully you can advice me on this one. I work on several project on two sites: the site the software wil run on eventually and on my laptop. The two sites differ: the operating system is different, the installed software is a bit different and the file system has another structure. When I pull from the git repository, the first thing I have to do is to adjust the software and inifiles a bit so that it runs on my laptop. When I push to the repository, I have to undo the changes before pushing. And the next time, I have to do exactly the same. I do the adjustments now in a commit on its own, so that I can undo that one with rebase, but I am still not comfortable with it. I have a feeling there must be a better way, a git way to apply and un-apply the environment changes. Can you advice me what commands I can use to tackle this little inconvenience? thanks, Ruud -- You received this message because you are subscribed to the Google Groups Git for human beings group. To post to this group, send email to git-us...@googlegroups.com. To unsubscribe from this group, send email to git-users+unsubscr...@googlegroups.comgit-users%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/git-users?hl=en. -- You received this message because you are subscribed to the Google Groups Git for human beings group. To post to this group, send email to git-us...@googlegroups.com. To unsubscribe from this group, send email to git-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/git-users?hl=en.
Re: [git-users] change another branch
Why do you do this? First putting all of your work only in one branch called _work_ is extremely self limiting. What if you have to work on a critical bugfix but are already in the middle of a new feature. I would ditch that concept and begin using topic branches. You shouldn't have to care which sha is at the tip of a branch. You could just simply merge _work_ into master. Or if you want to be really clean rebase _work_ and squeeze all of the commits into a single commit then merge into master. Using a reset in a normal workflow just has smell to it. On Sep 16, 2010, at 2:52 AM, ruud r.grosm...@gmail.com wrote: hello group, I use git for some months. Given the way I work, I find myself doing a certain sequence of git actions regularly. Although it isn't that much work, I was wondering if there is a one-command way of doing it. - branch _master_ contains the software version everybody uses - I do all my work in branch _work_ ; - if I am ready with my work, the branch lies one or more commits ahead on master. If we decide the changes are ready to submit to the repository, I want master to contain the changes and point to the same commit as work does. I do the following: - I check out the master branch - I do 'reset --hard work' so that master point to the same commit as work does - I check out work again to continue Is the same result possible without switching to the master branch? regards, Ruud -- You received this message because you are subscribed to the Google Groups Git for human beings group. To post to this group, send email to git-us...@googlegroups.com. To unsubscribe from this group, send email to git-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/git-users?hl=en. -- You received this message because you are subscribed to the Google Groups Git for human beings group. To post to this group, send email to git-us...@googlegroups.com. To unsubscribe from this group, send email to git-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/git-users?hl=en.
Re: [git-users] What to do when you get a conflict (rails) of schema.rb
Fwiw I recommend .gitignore'ing the schema.rb. You don't need it checked in its regenerated every migration and it's a magnet for useless conflicts. On Aug 26, 2010, at 7:20 AM, Pito Salas r...@salas.com wrote: Hmm. But it's a git-users question. Thanks anyway. On Wed, Aug 25, 2010 at 6:52 PM, Michael P. Soulier msoul...@digitaltorque.ca wrote: On 25/08/10 Pito Salas said: Hi all, This happens from time to time and I am not sure the right solution: Working on a rails application, I am merging my branch (where I did some migrations) with your branch (where you did some migrations too). Inevitably there's a conflict with schema.rb. What to do? I can manually fix the merge conflict, but I am still stuck with This is not a Git question. Mike -- Michael P. Soulier msoul...@digitaltorque.ca Any intelligent fool can make things bigger and more complex... It takes a touch of genius - and a lot of courage to move in the opposite direction. --Albert Einstein -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) iD8DBQFMdZ64KGqCc1vIvggRAjuFAJ43MMt6vUmiXnFedjGjf94Sbm73AQCfUXhd 6hVM8pVV+a7osWmzcb1V7oI= =TV0p -END PGP SIGNATURE- -- You received this message because you are subscribed to the Google Groups Git for human beings group. To post to this group, send email to git-us...@googlegroups.com. To unsubscribe from this group, send email to git-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/git-users?hl=en. -- You received this message because you are subscribed to the Google Groups Git for human beings group. To post to this group, send email to git-us...@googlegroups.com. To unsubscribe from this group, send email to git-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/git-users?hl=en.
Re: [git-users] What to do when you get a conflict (rails) of schema.rb
The schema.rb is primarily used in the db:test:prepare rake task that bootstraps your :test database when you run rake spec or rake test. You can bootstrap a non test database but I don't recall the command because I don't use it. So if you don't check it in ; and if you clone a project and immediately run the tests it will be unable to prepare the test database. If you db:migrate your dev database it will generate the schema.rb and your tests will be able to proceed. There are other reasons the schema.rb is useless to check in. Seed data; if your migrations add seed data that data won't be present in a database generated from the schema.rb. (rake db:seed is the new way to handle that problem) Stored procedures; if you've added stored procedures in your migrations, they won't be in a database generated from the schema.rb, also applies to foreign key constraints I believe. The most insidious is that it allows bizarre artifacts into the schema.rb as a result of development unless you are really diligent about resetting your development databases every time you switch checkouts. If you use the schema.rb to initialize production databases beware, but it can also break tests and waste time with useless conflicts. Consider creating a new topic branch, xyz based on abc. In xyz you add a migration that adds table xyz. You need to work on a bug on abc so you checkout abc and commit some migration; if you check the schema.rb carefully you'll notice the table xyz is in the schema.rb for branch abc. If abc and xyz are ever merged or ancestors of those are merged you'll likely end up with conflicts, or worse just the silent little artifacts of garbage slowly polluting your schema.rb. If you doubt what I say take and old project; where there are different developers; a goodly number of migrations; and they have been checking in the schema.rb; From a clean checkout; reset the development database; rake db:migrate it; I bet you will end up with a schema.rb that is different than the one checked in. For extra credit try to find what induced the modifications. On Aug 26, 2010, at 7:48 AM, Pita Salas r...@salas.com wrote: Yeah it's a mystery to me: the question about checking in schema.rb is heavily debated and the rails code itself STRONGLY advises to check it in. But I don't know why because what you say makes perfect sense to me too. -- Pito -- You received this message because you are subscribed to the Google Groups Git for human beings group. To post to this group, send email to git-us...@googlegroups.com. To unsubscribe from this group, send email to git-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/git-users?hl=en.
Re: [git-users] Merging workflow
Create a new branch all (or some other more descriptive name) based on daviddoria, then merge the other projects into it. You have your combined branch, and all of the source branches won't be polluted by each others commits. On Aug 12, 2010, at 7:22 AM, David Doria daviddo...@gmail.com wrote: Hi all, I have a branch called daviddoria. From this branch, I created multiple branches (Project1, Project2, and Project3). I want to have a branch where I can use everything from all three project branches. My question is - if I merge Project1 into daviddoria, won't this also affect Project2 and Project3 (i.e. the next time Project2 and Project3 are pulled they will get all of the changes made to Project1)? If that is correct, how can I make a branch that contains all of the changes to all of the projects but still keep all of the projects separate from each other? Thanks! David -- You received this message because you are subscribed to the Google Groups Git for human beings group. To post to this group, send email to git-us...@googlegroups.com. To unsubscribe from this group, send email to git-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/git-users?hl=en. -- You received this message because you are subscribed to the Google Groups Git for human beings group. To post to this group, send email to git-us...@googlegroups.com. To unsubscribe from this group, send email to git-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/git-users?hl=en.
Re: [git-users] listing what files were changed in commit
Git log --raw On Mar 19, 2010, at 3:22 AM, Marcin Krol mrk...@gmail.com wrote: Hello, I can list patches using git log -p. But sometimes that's too detailed and I just would like to display a list of files that were affected in a given commit. Is there some way to do it? -- Regards, mk -- Premature optimization is the root of all fun. -- You received this message because you are subscribed to the Google Groups Git for human beings group. To post to this group, send email to git-us...@googlegroups.com. To unsubscribe from this group, send email to git-users+unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/git-users?hl=en . -- You received this message because you are subscribed to the Google Groups Git for human beings group. To post to this group, send email to git-us...@googlegroups.com. To unsubscribe from this group, send email to git-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/git-users?hl=en.