Bitbucket credentials issue in source tree and git - bitbucket

I am not sure if this is the correct place for this. I used source tree to clone a bit bucket repo and was able to do it a couple of months ago. I was also able to push and pull. However, recently when I try to push and pull or even clone down another copy using the same credentials i get an invalid credentials message.
I have tried clearing out the windows credential manager, resetting my atlassian password, and trying to clone on a completely different computer with the same result.
It's weird because I can add my bitbucket account to source tree using the username and password but I cannot clone, pull, or push using those same credentials.
I do not have an errors message screenshot but could get one if the issue is not clear.
Thanks!
Update: Here is an interesting behavior happening out of sourcetree, when I try to clone a repo I get multiple login prompts. All of these fail when using the credentials.

It appears that the newest version of source tree has a few issues to work out. Downgrading to an older version, 1.9 I believe, I was able to perform cloneing, pulling, and pushing without issue.
I decided to look for alternative clients but source tree would still work on an older version.

Related

ghprbActualCommitAuthorMail returns wrong mail address

I am using the GitHub pull request builder plugin in Jenkins to make pull requests on GitHub automatically trigger Jenkins jobs.
I am using GitHub Enterprise and when I try to get the values of environment vars ghprbActualCommitAuthor and ghprbActualCommitAuthorMail, I get incorrect values:
ghprbActualCommitAuthor : GitHub Enterprise
ghprbActualCommitAuthorEmail : noreply#github.***.com
Please help, thanks!
This behavior is seen in GitHub Enterprise when users commit changes directly using the web UI or they have not set their email addresses.
According to GHE support:
This is by design, since the commit is actually done by the GitHub Enterprise instance. This is because we do not impersonate users when creating commits.
You can fix this by ensuring that users make commits only through the Git clients using their own SSH credentials or Personal Access Tokens.

How to upload an image to use in issue comments via Github API

I'm currently working with Github API to make an iOS github client app.
I'd like to implement the feature of creating issues with images. My question is how to upload an image for issue comments via API. We're able to upload the image by drag-and-drop via browser in github.com like image below:
I'd like to use this https://cloud.githubusercontent.com/assets/~~~.PNG.
Any way to upload to https://cloud.githubusercontent.com via API or something?
By the Feb 2020 there are still no official solution to upload files via API to be used in the github issues.
Simple solution is to use a repository branch (you can name it assets). You can link to them from the github issues easily, just use raw link with last commit SHA:
https://github.com/ORG/REPO/raw/LAST_SHA/PATH
This kind of link will be rendered in the issues body always correctly.
Ever I also try to find one way to make it.But there is not any available method to do it. I'm doing some extra test to find that you can observe the drag-and-drop action in your devtool-network panel.
I find that https://github.com/upload/assets/21842410 be requested with PUT method, and its response is {"id":21842410,"name":"-2.png","size":1261,"content_type":"image/png","href":"https://cloud.githubusercontent.com/assets/3518853/21842410/7c3f6812-d79b-11e6-8209-e49b44aaa883.png","original_name":null}
I've not finished my test, if this inspires you and you have time to implement any demo, please tell me your result. :)
A solution I'm using is to push the images to the repository instead, and use a relative link in the issue.
You can create an orphan branch just for images and push it to a ref outside of refs/heads, this way this ref is not cloned in a normal clone (you would need git clone --mirror).
It would look something like this (proof-of-concept):
git checkout --orphan images
git rm -rf *
# copy your images to the repo
git add <your images>
git commit -m "add images"
git push origin HEAD:refs/images/image-ref
git log --format=%H
# note the hash
and then in the issue, use a relative link using the commit hash from above:
![alt text](../blob/<HASH HERE>/path/to/your/image.png?raw=true)
It can't be done. Your only chance is to upload your image to your own s3 bucket or similar and link that in the comment/issue. I think github will pick up those and cache them for better user experienceon github.com

Unable to Merge

As regular user of bitbucket never face this problem before. Created Pull Request in regular way and when trying to merge it throws error without any details about reasons. Tried for several days with gap in between and also tried in different timing. What will be the reason and how to solve it.
Since you don't know any details about the error, just merge your branches in your command line:
git merge my-feature-branch
git push --all
(run this in the branch where you want my-feature-branch to be merged)
Also, if you consider so, you can always open an issue here.
For future reference, it also works when we open bitbucket instance in incognito.

Adding source control to my project in xcode

I am following this tutorial in raywenderlich.com: http://www.raywenderlich.com/22590/beginning-automated-testing-with-xcode-part-12. I have problem linking my project to my repo. I have already created the repo in my github account and downloaded the starter project.
I face two problems:
1) xcode keeps asking for my password and when i enter my github account password and username, it keeps saying my authenication is wrong. its username says git always...
2) In the tutorial, to get an initial commit it says: Go to File\Source Control\Commit (⌥⌘-C) and on the following screen, enter a commit message like “initial commit” and click Commit. but when i type initial commit, the commit is not highlighted and doesn't allow me to click it.
Need some guidance to start on source control for my iOS projects..
Honestly? Don't use Xcode for that. I know I am not answering your question, but there are better ways of doing it. At the moment I am using Command Line and it's more than enough for what I do. Sometimes I use SourceTree, but most of the times it's Command Line.
1) I think you clone your project from the github.com with the https link. You should choose the git one, something like this: git#github.com:username/projectname.git. Or you should refer to GitHub's help page at https://help.github.com/articles/set-up-git#platform-mac , which tell you to install the osxkeychain credential helper.
It is written on GitHub:
The credential helper only works when you clone an HTTPS repo URL. If you use the SSH repo URL instead, SSH keys are used for authentication. This guide offers help generating and using an SSH key pair.
2) Have not got any good idea right now.

Setting up git commit hook for Redmine

I am trying to migrate the setup here at the office from SVN to Git and am setting up Redmine as the host for our projects and issue management (Currently we use a version of Gforge + SVN). I should preface by saying that I'm an embedded C software developer by day and have basically zero experience with Rails or web apps, but I like trying new things so I volunteered to set up the project management tools which will take us into the future.
I have Redmine setup and am using Gitolite as the Git repo manager. Additionally, I am using the ericpaulbishop/redmine_git_hosting plugin to facilitate automatic public ssh key pushing to Gitolite and automatic repo creation when we register a new project. Everything seems to work except the repo view within the project does not keep track of the changesets. (The "History" is just empty, although when you view the files, it does show the latest version correctly)
I copied the post-receive hook from the plugin's contrib directory to the .gitolite/ common hooks, but again I know little about Ruby and how these gitolite hooks work so I don't know how to debug this. I notice there are log messages and things in the hook, but I have no idea where those are printed, etc...
I even tried the Howto on the Redmine wiki, HowTo setup automatic refresh of repositories in Redmine on commit:
#!/bin/sh
curl "http://<redmine url>/sys/fetch_changesets?key=<your service key>"
Any ideas on where I start debugging? I've been able to resolve every problem up to this point, but I'm a little stuck now. The plugin doesn't make it obvious how this is supposed to work, and to be honest, I'm not even sure if this is a problem with Redmine not reading the repo correctly (or at all), or gitolite not communicating as Redmine expects, etc...
I guess I could answer this...
I checked the issues under the Github page and I found this on:
https://github.com/ericpaulbishop/redmine_git_hosting/issues/89
Which was pretty much exactly my problem. This does appear to be a small bug in the plugin, but you can work around it by changing Max Cache Time to "1 minute or until next commit". This immediately fixed my problem. I simply left it like that but one of the posters claimed that you could change it back to until next commit and it works from then on...

Resources