Search code inside a Github project

Update Dec. 2021: search has been improved again, with Search for an exact string, with support for substring matches and special characters, or regexps. But only on cs.github.com, and still in beta (waitlist applies) Update January 2013: a brand new search has arrived!, based on elasticsearch.org: A search for stat within the ruby repo will … Read more

How to add license to an existing GitHub project

In your repository, click ‘Create new file’ 2. a) Type ‘LICENSE’, ‘LICENSE.md’ or ‘LICENSE.txt’ as the new file’s file name. b) The ‘Want to use a new template?’ dialog will appear. Choose your preferred license. The accepted answer is almost there, but confused me, because it said ‘click the blue plus’ – the interface may … Read more

Can you issue pull requests from the command line on GitHub?

UPDATE: The hub command is now an official github project and also supports creating pull requests ORIGINAL: Seems like a particularly useful thing to add to the hub command: http://github.com/defunkt/hub or the github gem: http://github.com/defunkt/github-gem I suggest filing an issue with those projects asking for it. The github guys are pretty responsive.

Is it possible to create a remote repo on GitHub from the CLI without opening browser?

CLI commands for github API v3 (replace all CAPS keywords): curl -u ‘USER’ https://api.github.com/user/repos -d ‘{“name”:”REPO”}’ # Remember replace USER with your username and REPO with your repository/application name! git remote add origin git@github.com:USER/REPO.git git push origin master

How to search on GitHub to get exact string matches, including special characters

You couldn’t (before 2022). The official GitHub searching rules: Due to the complexity of searching code, there are a few restrictions on how searches are performed: Only the default branch is considered. In most cases, this will be the master branch. Only files smaller than 384 KB are searchable. Only repositories with fewer than 500,000 … Read more

Renaming a branch in GitHub

As mentioned, delete the old one on GitHub and re-push, though the commands used are a bit more verbose than necessary: git push origin :name_of_the_old_branch_on_github git push origin new_name_of_the_branch_that_is_local Dissecting the commands a bit, the git push command is essentially: git push <remote> <local_branch>:<remote_branch> So doing a push with no local_branch specified essentially means “take … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)