[git-users] Preserving changes locally, and never commit them to anywhere
Hi everyone. My Git experience is somehow basic, so I don't even know which function name I am looking for. My question is as follows: I am working on one public project on GitHub. That project is being developed in Visual Studio *2012*. I am using Visual Studio *2013*. These 2 IDEs are mostly compatible, except the latter adds couple of lines to solution file, thus making it VS2013 file, still preserving compatibility with older versions. My usual working flow is to open the solution (and it will update the solution file), write some code, save changes to my files. Close the IDE. Revert changes to solution file. And commit, at last. Basically, I'd like to remove 2 unneeded steps from my working flow: updating solution file, reverting it back. Is there a way to tell GIT that after upgrading the solution file I don't want it to concider this change as one that needs to be added to the commit? Something like: GIT knows that there are couple of lines in one file that are only used by me and don't need to be commited. Hence IDE won't upgrade this file anymore, and I don't have to revert it each time I commit. Any ideas? Thanks in advance -- You received this message because you are subscribed to the Google Groups Git for human beings group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [git-users] Preserving changes locally, and never commit them to anywhere
Hi Oleg, There are probably other better solutions, but one way would be to add a .gitignore file listing the particular file you do not want tracked, and add the .gitignore itself file too. http://git-scm.com/docs/gitignore BR Gunnar On 02/19/14 11:35, Oleg Kosmakov wrote: Hi everyone. My Git experience is somehow basic, so I don't even know which function name I am looking for. My question is as follows: I am working on one public project on GitHub. That project is being developed in Visual Studio *2012*. I am using Visual Studio *2013*. These 2 IDEs are mostly compatible, except the latter adds couple of lines to solution file, thus making it VS2013 file, still preserving compatibility with older versions. My usual working flow is to open the solution (and it will update the solution file), write some code, save changes to my files. Close the IDE. Revert changes to solution file. And commit, at last. Basically, I'd like to remove 2 unneeded steps from my working flow: updating solution file, reverting it back. Is there a way to tell GIT that after upgrading the solution file I don't want it to concider this change as one that needs to be added to the commit? Something like: GIT knows that there are couple of lines in one file that are only used by me and don't need to be commited. Hence IDE won't upgrade this file anymore, and I don't have to revert it each time I commit. Any ideas? Thanks in advance -- You received this message because you are subscribed to the Google Groups Git for human beings group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Git for human beings group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [git-users] Preserving changes locally, and never commit them to anywhere
On 02/19/14 12:31, Gunnar Strand wrote: Hi Oleg, There are probably other better solutions, but one way would be to add a .gitignore file listing the particular file you do not want tracked, and add the .gitignore itself file too. http://git-scm.com/docs/gitignore BR Gunnar On 02/19/14 11:35, Oleg Kosmakov wrote: Hi everyone. My Git experience is somehow basic, so I don't even know which function name I am looking for. My question is as follows: I am working on one public project on GitHub. That project is being developed in Visual Studio *2012*. I am using Visual Studio *2013*. These 2 IDEs are mostly compatible, except the latter adds couple of lines to solution file, thus making it VS2013 file, still preserving compatibility with older versions. My usual working flow is to open the solution (and it will update the solution file), write some code, save changes to my files. Close the IDE. Revert changes to solution file. And commit, at last. Basically, I'd like to remove 2 unneeded steps from my working flow: updating solution file, reverting it back. Is there a way to tell GIT that after upgrading the solution file I don't want it to concider this change as one that needs to be added to the commit? Something like: GIT knows that there are couple of lines in one file that are only used by me and don't need to be commited. Hence IDE won't upgrade this file anymore, and I don't have to revert it each time I commit. Any ideas? Thanks in advance Apologize for the previous top-posting. Well, after a quick search I have to update my answer. You are probably better off adding the file to a global gitignore file so you do not have to add the local gitignore file each time the repo is cleaned or cloned. The following link shows how to set up a personal gitignore file: http://stackoverflow.com/questions/7335420/global-git-ignore BR Gunnar -- You received this message because you are subscribed to the Google Groups Git for human beings group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Git for human beings group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- You received this message because you are subscribed to the Google Groups Git for human beings group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [git-users] Preserving changes locally, and never commit them to anywhere
On Wednesday, February 19, 2014 12:31:26 PM UTC+1, Gunnar Strand wrote: Hi Oleg, There are probably other better solutions, but one way would be to add a .gitignore file listing the particular file you do not want tracked, and add the .gitignore itself file too. http://git-scm.com/docs/gitignore Since the file is already tracked in this case, doing a normal ignore will not help. -- You received this message because you are subscribed to the Google Groups Git for human beings group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [git-users] Preserving changes locally, and never commit them to anywhere
On 02/19/14 12:56, Thomas Ferris Nicolaisen wrote: On Wednesday, February 19, 2014 12:31:26 PM UTC+1, Gunnar Strand wrote: Hi Oleg, There are probably other better solutions, but one way would be to add a .gitignore file listing the particular file you do not want tracked, and add the .gitignore itself file too. http://git-scm.com/docs/gitignore http://git-scm.com/docs/gitignore Since the file is already tracked in this case, doing a normal ignore will not help. Right, I stand corrected. It even appears to be gitignore 101. After some researching using the normal tools, your suggestion of using assumed-unchanged seems appropriate. I find this an interesting problem, but I have been unable to find any trivial solution. As an alternative, I added the following to a pre-commit hook: git checkout ignoreme git reset HEAD ignoreme This would also solve the problem, but is less elegant than --assume-unchanged. However, a pull after a commit would result in the ignored file to be updated with the upstream changes. But the above test also revealed what I believe is a bug in git. After the pre-commit is executed with git reset, the ignoreme file is still listed as being committed: # Changes to be committed: # (use git reset HEAD file... to unstage) # # modified: ignoreme # And adding a commit message results in an empty commit: ign2$ git --no-pager diff HEAD^ HEAD ign2$ I think git should reevaluate the state after the pre-commit hook has been executed, and not create an empty commit unless --allow-empty is given to commit. I've submitted this on the bug list. BR Gunnar -- You received this message because you are subscribed to the Google Groups Git for human beings group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.