Adding source control to my project in xcode - ios

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.

Related

Bitbucket credentials issue in source tree and git

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.

How do I remove a CircleCI check from a GitHub repo?

Recently my company has gone with Jenkins as its CI/CD solution, after trying a number of options. I'd like to disable checks from the other CI packages.
I've deleted the SSH key and web hooks from Circle CI, but it still marks the build check as "failed" on the merge requests (it's only partially implemented.)
I'd like there not to be a CircleCI check at all. How do I accomplish that?
From within CircleCI, click unfollow and then remove.
Going to a user|organisation profile Settings, then "Third-party application" can also help to remove Circle-CI.
This approach worked for me:
https://discuss.circleci.com/t/remove-projects-we-accidentally-added/27766
You create a script with your token and group name, then create a file with your repo name in it and run the script with the file as a param.

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

Why is my travis-ci build status always reflected as unknown?

I setup travis-ci for a new rails project, but for some reason the build status is always shown as unknown in my README. I have googled a bit and not been able to find any solutions. Although I have had some similar symptoms as others. E.g., all of my builds show they are still building, but if you look at the individual builds they are passed or failed.
BTW, should this be reported as a travis-ci issue?
I ran in to the same issue. I was able to address the issue by adding the branch parameter to the image url:
This url did not work
https://travis-ci.org/kandadaboggu/iprofiler.png
This url worked
https://travis-ci.org/kandadaboggu/iprofiler.png?branch=master
.com will not work here, as per latest. This works for me
## Travis-Build
[![Build Status](https://api.travis-ci.org/sananand007/genTspsolver.png?branch=master)](https://travis-ci.org/sananand007/genTspsolver)
Travis-Build
I use the Travis badge in our project's README in Github and I had the same issue. It turned out I did not have the correct settings in Travis.
From your Travis dashboard, go to More options => Settings. For me, I needed to turn on "Build pushed branches." After that, I clicked More options => Trigger build, and triggered a build.
Once Travis ran (and passed), I went back to Github and hard refreshed the page. The Travis badge had updated to green, or "build: passing".
In my case, the links I used were based on travis-ci.org when as of May 2018, all links should use travis-ci.com
See this announcement
This registered unknown
https://travis-ci.org/jlboat/FastaUtils.png?branch=master
This registered passing
https://travis-ci.com/jlboat/FastaUtils.png?branch=master
My issue was just that I this was my first build on travis-ci.org after I made my app public instead of private. I just had to wait for the image to be updated to reflect the new build status, which took a couple minutes. It is a free service on the .org rather than the paid service on the travis-ci.com so we have to wait on the shared resources to create the build status image.
In my case, the issue resolved by opening the image url on browser. You can get the image url from the Status Image popup by clicking build status badge on your project dashboard. The build status changed immediately after the image url fully loaded on the browser. For example click me
Follow a simple rule: use link of your travis repository dashboard.
In my case it's https://travis-ci.com/<username>/<repository>

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