I can clone the repository by this command:
exec("git clone pull https://user:password@bitbucket.org/user/repo.git");
But, can't pull from any branch by this command:
exec("git pull https://user:password@bitbucket.org/user/repo.git mybranch");
Any idea?
UPDATE: I found the solution after debugging a lot :) At first, I cloned my desired branch by this command:
exec("git clone pull https://user:password@bitbucket.org/user/repo.git --branch branch_name path_to_clone");
Then created a new file inside the repository ('path_to_clone'). And inside that, added the pull command:
exec("git pull https://user:password@bitbucket.org/user/repo.git branch_name");
It works fine!!