Matlab GIT which remote branch is being used.

16 次查看(过去 30 天)
I am able to clone a GIT repository into my local sandbox, create a local branch, make changes, and commit to the local repository.
However, how do I know which branch does my change is going to be pushed into. How do I know which remote branch is associated with the local branch.
Using command line, I would do "git checkout --track origin/<branch name>".
Thanks for any help.
Norman

回答(2 个)

Xiaodong
Xiaodong 2015-4-16
Local branch is not associated with a remote repository or branch. In fact, you can choose the remote repository and the branch you want to push into. In git, you can use command
``` git push REPO BRANCH ```
Since Matlab only partially implemented the git interface, I am not sure if this command works for the Matlab 2015a. Help it works on your side.

Norman Lo
Norman Lo 2015-4-16
Thank you very much for your answer. We are trying to use as few commands as possible and stick to using the menu options in the folder list.
Here is what I don't understand. Let's say in the remote server, there is a branch called "origin/branch1". I create a local branch with the same name (branch1). I made all my modifications/commits to the local branch.
After I clicked on the "Push" option from the menu, in the branch view, it is showing the branch1 and origin/branch1 are pointing to the same locations. And I checked that origin/branch1 is getting the same modifications.
I am trying to understand how the "push" menu option know which branch it is trying to push the modifications to, Is it just because the branches in the local and remote branch has the same name (branch1).
Thank you very much again.
  1 个评论
Xiaodong
Xiaodong 2015-4-16
I would think so. So far, the Git interface in Matlab has not been fully implemented yet (I just submitted a bug report on commit message). Therefore, I would suggest you to use command line instead of clicking buttons to make sure everything works as expected. Bugs or new features should direct to matlab's support team. Good luck!

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Source Control Integration 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by