2

I am working on a group project with some people and we have two active branches.

Up to now I have been working on the master branch until we came across some problems with the application. Someone made a different branch with different configurations (to try and address the problems on master).

I am tracking this branch now and have checked out.

However, when I try gradle build or test or cucumber I am getting the same errors I was getting on master. This should not be the case as the guy who made the branch is able to build without these errors.

I believe gradle is still trying to build from master rather than the branch I am on. Am I doing something obviously wrong?

tinOfBeans
  • 707
  • 1
  • 9
  • 22
  • 2
    Can you elaborate on how you've checked out the branch ? did you do a `git pull` ? – Acemad Apr 15 '16 at 20:41
  • 2
    *I believe gradle is still trying to build from master rather than the branch I am on.* This sounds more like a git issue than a gradle problem. – RaGe Apr 15 '16 at 21:16
  • Could you please explain how you change you branches? Could it be that the problems are caused by files which are not under version control? Nevertheless that sounds like a git but not gradle problem. Or are you using something special gradle plugins which might modify your branches? – TobiSH Apr 16 '16 at 17:32

1 Answers1

0

TO be sure you are on the right branch, you can create a second worktree following said branch (git 2.5+ with git worktree add):

cd /path/to/repo
git branch # check you are on master
git worktree add ../secondBranch <name of second branch>
cd ../secondBranch
git branch # check you are on second branch

That way, no need for a second clone or for switching branches: the two folders (repo and secondBranch) are all set.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250