I want to be able to tag a branch to automatically being pulled. Netbeans should keep the tagged branch always up to date with the remote branch.
This is helpful if you have for example a remote master branch you have to merge into. You develop in a feature branch but you have to merge into the master branch later. Keeping up to date with the remote branch is a bit complicated today. On the command line you would need:
git checkout master
git checkout your working branch
With the UI it is even more complicated because stashing is only supported via export.
This feature helps to avoid merge issues for those who are used to subversion where the remote branch is implicitly up to date because you fetched the server. I have several branches where I have to do reviews and it is annoying to keep them up to date.
Do you mean something like:
1) stay on the feature branch and do not leave it
2) automatically call git fetch
3) and then something like "git reset origin/master" called on master? In other words move master branch to the same commit as origin/master, of course only if it does not contain any local commit.
Yes, except that I want that feature not only for the master branch. I want to be able to follow several branches at latest commit. And you are right, the reset is probably better than a pull. This is very handy if you follow (review) several branches.
i would like to have this split into two steps (two issues):
step #1: nothing would be automatic, an action will be enabled on e.g. "master" [Sync with origin/master] that will only move master on top of origin/master - of course only when merge is not needed: so you will still have to:
1) git fetch/pull
2) then occasionally do "Sync with origin/XYZ" from the popup in the repository browser
It should still save you a lot of time, but will be faster and easier to implement than:
step #2: do automatic fetch and do step #1 without user manually calling it. There are several questions i need to evaluate (working network connetions, corrrect credentials, run not very often etc.)
So i think i will be able to do step #1 for the current NB release.
This sounds like a very good idea, since you might work off line and then you will always get failures. That might be possible to handle but the manual version seems smarter.
From the users perspective it also makes sense. You press a button to fetch new stuff. You expect updates, and you expect failures, e.g. when merges are required. If everything would be automatic you would get a pop-up while you are doing something else, not expecting this pop-up/problem.
You don't need to do it occasionally, you can use the fetch as a trigger. You only need to flag the branches you want to sync and sync after fetch.
Let's agree on this:
- in the repository browser open the popup menu on a local branch
- select/unselect the option "[x] Automatically Synchronize with "origin/master"
- when selected then the local branch will be synced after a fetch/pull automatically.
Integrated into 'main-silver', will be available in build *201406240001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
User: Ondrej Vrabec <firstname.lastname@example.org>
Log: #244707 - Automatically pull branch
Automatically sync tracking branches after a fetch or pull