Re: Need help migrating workflow from svn to git.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Josef Wolf <jw@xxxxxxxxxxxxx> writes:

> With git, by contrast, this won't work. Git will refuse to pull anything as
> long as there are ANY local modifications. The cron job would need to
>
>    git stash
>    git pull
>    git stash pop

I'd assume that this "pull" is expected to be fast-forward, as
otherwise you have no way of dealing with conflicted merges.

> But this will temporarily remove my local modifications. If I happen to do
> a test run at this time, the test run would NOT contain the local
> modifications which I was about to test. Even worse: if I happen to save
> one of the modified files while the modifications are in the stash, the
> "git stash pop" will definitely cause a conflict, although nothing really
> changed.
>
> So, how would I get this workflow with git? Is it possible to emulate the
> behavior of "svn update"?

You do not mind a temporary inconsistency while "svn update" runs
(it starts to update a file you may have local changes, but your
test may run while the update is in the middle of it).  So perhaps
something along the lines of this would help.  Assuming

    <remote> <branch>: the branch at the remote you are pulling from
    <master>: whatever branch you are using

are in your three-command example above:

    $ git fetch <remote> <branch>
    $ git checkout -m -B <master> FETCH_HEAD

should give you pretty-much identical result as

    $ git stash && git pull --ff-only && git stash pop

including a possible merge conflicts at 'git stash pop' stage.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux