[git-users] Problem with two copies of same branch diverging
I posted this to the git mailing list, but it's a beginner question, so I think it's better posted here. Hi, Thanks for reading my question. I have two copies of code checked out at the same branch. Desktop and remote server. I use an IDE that automatically SFTP transfers each save from the desktop to the remote server, so I can run my changes on the server environment. At the end of the session, I commit the code on my desktop, do a git push to the repo. When I look at the server, the code there is identical to what's on my desktop box and what I just comitted and pushed, but, of course, git status thinks it's all modified and wants me to either commit it or stash it. In fact, doing a git log on the server doesn't show my latest push. So I need to pull the changes, but I can't because I have pending stuff. What's a good git workflow for this save-upload-remote test cycle? Thanks, -- 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/d/optout.
[git-users] Overriding the "git merge" command
Hello, I am a PhD candidate researching about merge tools and doing experiments with git and github. I know that when the *git merge* command fails in presence of conflicts, it is possible to invoke external merge tools through the command* git mergetool* to resolve conflicts. I was wondering if is that possible to set the *git merge* command to call the external merge tool directly, in any situation, not only when there are conflicts. More specifically, as far as I know, the workflow is: 1. call "git merge" 2. if there is conflict, call "git mergetool" to invoke an external merge tool What I want is: 1. call "git merge" to invoke an external merge tool Is that possible? If so, how? 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/d/optout.
Re: [git-users] Overriding the "git merge" command
On Thu, 4 Aug 2016 08:33:57 -0700 (PDT) Guilherme Cavalcanti wrote: > I am a PhD candidate researching about merge tools and doing > experiments with git and github. > I know that when the *git merge* command fails in presence of > conflicts, it is possible to invoke external merge tools through the > command* git mergetool* to resolve conflicts. > I was wondering if is that possible to set the *git merge* command to > call the external merge tool directly, in any situation, not only > when there are conflicts. > More specifically, as far as I know, the workflow is: > >1. call "git merge" >2. if there is conflict, call "git mergetool" to invoke an > external merge tool > > What I want is: > > >1. call "git merge" to invoke an external merge tool > > Is that possible? If so, how? Supposedly yes -- via the so called "git attributes" (run `git help attributes` to see the manual page). One of the supported attributes is the "merge driver" which might be set to a program to be invoked to perform a merge. I don't know if it's possible (or has any sense) to invoke an interactive application through this mechanics, though. -- 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/d/optout.
Re: [git-users] Overriding the "git merge" command
Nice. Many thanks. I'll give it a try and inform here.. Em quinta-feira, 4 de agosto de 2016 13:15:57 UTC-3, Konstantin Khomoutov escreveu: > > On Thu, 4 Aug 2016 08:33:57 -0700 (PDT) > Guilherme Cavalcanti > wrote: > > > I am a PhD candidate researching about merge tools and doing > > experiments with git and github. > > I know that when the *git merge* command fails in presence of > > conflicts, it is possible to invoke external merge tools through the > > command* git mergetool* to resolve conflicts. > > I was wondering if is that possible to set the *git merge* command to > > call the external merge tool directly, in any situation, not only > > when there are conflicts. > > More specifically, as far as I know, the workflow is: > > > >1. call "git merge" > >2. if there is conflict, call "git mergetool" to invoke an > > external merge tool > > > > What I want is: > > > > > >1. call "git merge" to invoke an external merge tool > > > > Is that possible? If so, how? > > Supposedly yes -- via the so called "git attributes" > (run `git help attributes` to see the manual page). > One of the supported attributes is the "merge driver" which might be > set to a program to be invoked to perform a merge. > > I don't know if it's possible (or has any sense) to invoke an > interactive application through this mechanics, though. > -- 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/d/optout.
Re: [git-users] Problem with two copies of same branch diverging
Hello, I would either stash or commit. Stashing essentially puts away your non-committed changes to a safe storage. You do a git pull, making the server up to date. When it is done, just pop your stash. You can also go with committing. Just git add everything, commit with a random message. Then do a git pull --rebase. This will get the changes from the central repo, and put your temporary commit on it. If you didn't make any changes on the server, both popping the stash and rebasing your temporary commit will effectively be a no-op, and your working directory will be clean. If you actually make changes on the server, you will have those modifications as uncommitted file changes (with stashing) or as a small commit with your temporary message (with commit+rebase). Best, Gergely On Aug 4, 2016 17:11, "Ed Greenberg" wrote: > I posted this to the git mailing list, but it's a beginner question, so I > think it's better posted here. > > Hi, Thanks for reading my question. > > I have two copies of code checked out at the same branch. Desktop and > remote server. > > I use an IDE that automatically SFTP transfers each save from the desktop > to the remote server, so I can run my changes on the server environment. > > At the end of the session, I commit the code on my desktop, do a git push > to the repo. > > When I look at the server, the code there is identical to what's on my > desktop box and what I just comitted and pushed, but, of course, git status > thinks it's all modified and wants me to either commit it or stash it. In > fact, doing a git log on the server doesn't show my latest push. So I need > to pull the changes, but I can't because I have pending stuff. > > What's a good git workflow for this save-upload-remote test cycle? > > Thanks, > > -- > 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/d/optout. > -- 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/d/optout.