Can't perform git push/fetch/pull from Command Window
이전 댓글 표시
I'm not familiar with Git or GitHub before; my first introduction to these tools are by the integration with MATLAB. I set it up and works well when performing actions through interface (right click on the Current Folder > Source Control > [Action]). I have also set up SSH key so that I don't have to enter my username and password everytime I want to push/fetch/pull. To make the process easier, I want to be able to perform actions through Command Window by starting the command with:
!git ...
However, all actions that require communication with the remote failed, for example:
!git push origin master

What can I do to fix this problem? Thank you!
댓글 수: 5
Mario Malic
2020년 9월 6일
편집: Mario Malic
2020년 9월 6일
I don't think that !git status checks the connection with the repository.
Maybe you should try with this
!git push master /origin/master
Adib Yusof
2020년 9월 6일
Mario Malic
2020년 9월 6일
편집: Mario Malic
2020년 9월 6일
Actually your command is correct.
!git push origin master
I made a test repository and i managed to push it there with this, but I set it up as a project in MATLAB.
You can try to set the repository URL from Remote button, and try to use then the command.
Edit:
- Check if your RSA key is in .ssh directory
- See if you get your repository links by this command
!git remote -v
- Maybe change the commit mail to match the one in your account
!git config --global user.email "email@example.com"
Lastly, try this command https://docs.github.com/en/github/authenticating-to-github/testing-your-ssh-connection
Adib Yusof
2020년 9월 7일
Mario Malic
2020년 9월 7일
The last thing to suggest is to re-do again this guide https://ch.mathworks.com/help/matlab/matlab_prog/set-up-git-source-control.html
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!