Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Could not push branch" error #75

Closed
soulburner opened this issue Jul 1, 2017 · 26 comments
Closed

"Could not push branch" error #75

soulburner opened this issue Jul 1, 2017 · 26 comments
Labels
Milestone

Comments

@soulburner
Copy link

I've made all steps of the tutorial, but when I try to Push, I've got a error saying
"Could not push branch"

error

Attached a log file, but doesn't see anything wrong there.
github-unity.log.txt

@Ansraer
Copy link

Ansraer commented Jul 2, 2017

I appear to have the same problem.
If you really want to push your changes to the remote branch you can use the command line (top menu GitHub>Command Line) with the command "git push -u origin master".
Or you could simply import the project into the Github desktop app and push it from there.

Would be great if someone could help us get this working inside Unity though.

@StanleyGoldman
Copy link
Member

@soulburner is that the right log file. There should be a log of us even attempting.
Every time you start unity we move github-unity.log to github-unity.log.txt.

@Jacky2611 if you can catch me on gitter I wouldn't mind working with you interactively to figure it out. I'm in the Eastern Standard timezone, won't be online much Monday/Tuesday for holiday.

@soulburner
Copy link
Author

soulburner commented Jul 2, 2017

@StanleyGoldman that's the right log file. I've renamed it to .txt because couldn't attach a .log file.

If you mean the ".old" log, that's not the issue. I've started the unity, tried to push, got an error, closed, attached the log.

I've monitored the log and these lines appeared after I've tried to push:

170702-01:29:02 TRACE [10] Start git push
170702-01:29:02 TRACE [10] IsBusyChanged Value:True
170702-01:29:02 TRACE [10] IsBusyChanged Value:False
170702-01:29:02 TRACE [10] Finish git push

@StanleyGoldman
Copy link
Member

Apologies, I didn't see that message in the log file initially.

@StanleyGoldman
Copy link
Member

So I'm looking at the code in question, and we definitely are not logging enough in that area. So that's about all the logs I'm going to get. 😆

Have either of you tried to build to code yet?
If you are interested in trying, we could try to get us more information on this problem sooner.

@soulburner
Copy link
Author

Hey, @StanleyGoldman, I could try to help.

By the way, I've just downloaded github-for-unity to the whole another machine and it gives me the exact same error.

About building... I've downloaded the sources, but seems that I have something missing (octokit?):
image

I've tried to google how to install an Octokit and found out some nuget manager. But when I try to install it, I get this error:
error

PS: I've got MS VS 2015

@StanleyGoldman
Copy link
Member

Awesome... You will want to start here: how to build

@StanleyGoldman
Copy link
Member

StanleyGoldman commented Jul 2, 2017

It's a custom version of octokit that runs in Unity, so it's not on nuget.

@soulburner
Copy link
Author

@StanleyGoldman ohh... that's becoming too complicated. I've downloaded the octokit you're using. But couldn't open it because VS said it misses some Win 8.1 tools and SDKs. I've tried to auto-install missing updates, but it said it wants a Studio .ISO image that I don't have now.

@StanleyGoldman
Copy link
Member

Hmm okay. Don't worry about it. I will find the bug.

@soulburner
Copy link
Author

@StanleyGoldman hmm... I've realized that I can include DLLs from the plugin and use them instead of compiling Octokit.

So, I've came to the point when I can build the whole Github.Unity solution.

What's next? :)

@StanleyGoldman
Copy link
Member

StanleyGoldman commented Jul 2, 2017

Awesome 🏆.

In the mean time, there are a few calls to our log function that are commented out in this class, TaskBase. If we let them run all the time they would make too much noise in the log file. See if you can un-comment a few of them and capture a log with some more detail.

Other than that, I have to find where the output is being processed. We removed it from the log because it can sometimes contain sensitive information like your authentication keys. Give me some time I will give you a branch to try out for us.

(Next time you should really follow the instructions here cause they should instruct you on how to clone and build properly.)

@soulburner
Copy link
Author

soulburner commented Jul 2, 2017

Ok, here's the extended version of a log file:

170702-22:41:16 TRACE [11] Exception on exclusive thread: 1 git push
bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for 'https://github.com': Invalid argument
at GitHub.Unity.ProcessTask1+<RunWithReturn>c__AnonStorey0[System.String].<>m__0 () [0x00114] in /Users/shana/code/work/github/Unity/src/GitHub.Api/NewTaskSystem/ProcessTask.cs:295 at GitHub.Unity.ProcessWrapper.Run () [0x002d4] in /Users/shana/code/work/github/Unity/src/GitHub.Api/NewTaskSystem/ProcessTask.cs:164 at GitHub.Unity.ProcessTask1[T].RunWithReturn (Boolean success) [0x0005c] in /Users/shana/code/work/github/Unity/src/GitHub.Api/NewTaskSystem/ProcessTask.cs:305
at GitHub.Unity.TaskBase1[TResult].<TaskBase>m__0 () [0x00000] in /Users/shana/code/work/github/Unity/src/GitHub.Api/NewTaskSystem/TaskBase.cs:406 at System.Threading.Tasks.Task1[System.String].InvokeFuture (System.Object futureAsObj) [0x00000] in :0
at System.Threading.Tasks.Task.InnerInvoke () [0x00000] in :0
at System.Threading.Tasks.Task.Execute () [0x00000] in :0

@StanleyGoldman
Copy link
Member

Escaping it different so it's more readable

170702-22:41:16 TRACE [11] <TaskManager>                    Exception on exclusive thread: 1 git push
bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for 'https://github.com': Invalid argument
  at GitHub.Unity.ProcessTask`1+<RunWithReturn>c__AnonStorey0[System.String].<>m__0 () [0x00114] in /Users/shana/code/work/github/Unity/src/GitHub.Api/NewTaskSystem/ProcessTask.cs:295 
  at GitHub.Unity.ProcessWrapper.Run () [0x002d4] in /Users/shana/code/work/github/Unity/src/GitHub.Api/NewTaskSystem/ProcessTask.cs:164 
  at GitHub.Unity.ProcessTask`1[T].RunWithReturn (Boolean success) [0x0005c] in /Users/shana/code/work/github/Unity/src/GitHub.Api/NewTaskSystem/ProcessTask.cs:305 
  at GitHub.Unity.TaskBase`1[TResult].<TaskBase>m__0 () [0x00000] in /Users/shana/code/work/github/Unity/src/GitHub.Api/NewTaskSystem/TaskBase.cs:406 
  at System.Threading.Tasks.Task`1[System.String].InvokeFuture (System.Object futureAsObj) [0x00000] in <filename unknown>:0 
  at System.Threading.Tasks.Task.InnerInvoke () [0x00000] in <filename unknown>:0 
  at System.Threading.Tasks.Task.Execute () [0x00000] in <filename unknown>:0 

@StanleyGoldman
Copy link
Member

🎖 @soulburner 🎖

Thanks for the debugging man, you definitely gave me a few clues.

@StanleyGoldman
Copy link
Member

Umm... 😸 Can I get a bit more logs than that piece?

@soulburner
Copy link
Author

Here's the full log:

github-unity.log.txt

@mbbmbbmm
Copy link

mbbmbbmm commented Jul 9, 2017

I can only push to remote branch if I point GitHub for Unity to my installed git.exe manually. But it reverts to the portable version all the time which cannot find the credentials. Pressing "find install" does nothing. What can I do to fix this? Thanks!
edit: unity 5.6.1, windows 10, git version 2.13.2.windows.1

@StanleyGoldman
Copy link
Member

Hey @mbbmbbmm I haven't started chasing @soulburner's issue yet, but it seems you have discovered a different issue. I opened up #102. Let me know if there are any more details you could provide there.

@PPeMg
Copy link

PPeMg commented Jul 25, 2017

Hi!

I had the same problem as @soulburner . When I tried to push from the console with git push -u origin master I get the message this message:
Remote "origin" does not support the LFS locking API. Consider disabling it with: $ git config lfs.https://github.com/PPeMg/XBLOQUES-3D2.git/info/lfs.locksverify false Git credentials for https://github.com/PPeMg/XBLOQUES-3D2.git not found. error: failed to push some refs to 'https://github.com/PPeMg/XBLOQUES-3D2.git'

Disabling the LFS it works on the console, but not in the plugin. Maybe that API is related to the issue, or maybe is some error in GIT config.

I hope that I helped you.

EDIT: OK, it was my fault, I weren't config the credentials. I finally config my credentials as "store" and this is the only way i got the plugin works. I think the problem with that issue is the same, if you don't configure git with your credentials it doesn't works. Maybe you should code a login prompt when the system haven't got the credentials to commit in the repo.

@StanleyGoldman
Copy link
Member

Hey @PPeMg Glad you figured it out, we will get this area figured out soon. Promise!

@StanleyGoldman
Copy link
Member

Hey @soulburner. There have been a lot of changes in the code base since we last spoke. Would you mind downloading the latest build and seeing if you are able to push. If not we will try to take it from there.

@StanleyGoldman
Copy link
Member

Hey @soulburner, I'm going to close out this issue, if you can reproduce the problems with a current build, please fell free to open a new issue.

@StanleyGoldman StanleyGoldman added this to the 0.18 milestone Sep 1, 2017
@JoakimLarsson
Copy link

JoakimLarsson commented Sep 13, 2017

Ok, so the problem is not a bug I think, I got the same dialog like 100 times before I managed to push the initial generated changes.

I started out with git installed in a pure msys64 environment with 'pacman -S git' My first thought was to install git lfs using 'pacman -S git-lfs' but that package is not available. So next step was to install the Windows binary which I did no problem.

Nothing worked still, so I added went through all the tips I could find until I realized that there is a Windows Git I could install.

After I've done that it was still some problem with the credentials, so i'd did the ugly ' git config --global credential.helper store' and then clones another project from the command line just to set the credentials.

I think it would be very much appreciated if a password dialog had popped up asking for credentials and also download links for the Windows versions of Git and Git Lfs, it would saved me an hour or two, most people would have moved on instead I think.

However, now that it is set up correctly it looks very smooth, thanks for the effort making it! 👍

@StanleyGoldman
Copy link
Member

Hey @JoakimLarsson thanks for sticking through it and I'm glad you got it working. The software is still Alpha after all, so please understand that we are still working out the kinks.

Just to explain... (for you and anyone else that comes across this)

https://github.com/github-for-unity/Unity#git-on-windows

We explain that you just need a .gitconfig file in your home directory to use the plugin. The plugin has Git and Git LFS bundled already.

We currently only support wincred. We only set your machine to wincred if you don't have a credential manager configured. (If you had something else configured already we did not want to change it on you).

After you set your configuration to wincred you can authenticate using the steps we listed here:

https://github.com/github-for-unity/Unity#authentication

After that you should be able to push without a problem.

@StanleyGoldman
Copy link
Member

Also...

If anything seems too hard... like you are dumping an hour+ into getting something to work.
Just come find us on gitter or discord. We could've saved you some time...

https://discordapp.com/invite/5zH8hVx
https://gitter.im/github-for-unity/Unity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants