Questions tagged [github]

GitHub is a web-based hosting service for software development projects that use Git for version control. Use this tag for questions specific to problems with repositories hosted on GitHub, features specific to GitHub, and using GitHub for collaborating with other users. Do not use this tag for Git-related issues simply because a repository happens to be hosted on GitHub.

GitHub is a web-based Git repository hosting service. It offers all of the distributed revision control and source code management (SCM) functionality of Git, as well as adding its own features.

Unlike Git, which is strictly a command-line tool, GitHub provides a Web-based graphical interface with desktop, as well as mobile, integration. It also provides access control and several features for collaboration such as bug tracking, feature requests, task management, and wikis for each hosted project.

GitHub offers plans for private repositories, as well as free accounts, which are usually used to host open-source software projects. As of January 2023, GitHub reports having more than 100 million users and more than 372 million repositories, making it the largest host of source code in the world.

GitHub Pages is a service they offer that will host static websites using code from a public repository's main branch. The URL format is https://username.github.io.

Source: GitHub Wikipedia

Using pull requests

Pull requests let you tell others about changes you've pushed to a repository on GitHub. Once a pull request is sent, interested parties can review the set of changes, discuss potential modifications, and even push follow-up commits if necessary.

Tutorial: Creating a Pull Request

Resources

Graphical clients for certain platforms:

56809 questions
997
votes
65 answers

git error: failed to push some refs to remote

I can't push now, though I could do it yesterday. When I use git push origin master, I get an error: $ git remote -v origin https://github.com/REDACTED.git (fetch) origin https://github.com/REDACTED.git (push) $ git push origin master Username…
leipzy
  • 11,676
  • 6
  • 19
  • 24
943
votes
8 answers

Link to the issue number on GitHub within a commit message

Is it somehow possible to automatically have a link to GitHub issue number in the git commit message?
Mika Tuupola
  • 19,877
  • 5
  • 42
  • 49
928
votes
11 answers

git - remote add origin vs remote set-url origin

I create a new repository: git init echo "# MESSAGE" >> README.md git add README.md git commit -m "first commit" Then I want to push my commit to the empty remote repository created on github so I have to set remote. What is difference between…
Irbis
  • 11,537
  • 6
  • 39
  • 68
921
votes
17 answers

There is no tracking information for the current branch

I've been using github from a relatively short period, and I've always used the client to perform commits and pulls. I decided to try it from the git bash yesterday, and I successfully created a new repo and committed files. Today I did changes to…
valerio0999
  • 11,458
  • 7
  • 28
  • 56
900
votes
40 answers

Download single files from GitHub

What are some tips on downloading a single file from a GitHub repo? I don't want the URL for displaying the raw file; in the case of binaries, there's nothing. http://support.github.com/discussions/feature-requests/41-download-single-file Is it even…
Radek Simko
  • 15,886
  • 17
  • 69
  • 107
876
votes
18 answers

Make the current commit the only (initial) commit in a Git repository?

I currently have a local Git repository, which I push to a Github repository. The local repository has ~10 commits, and the Github repository is a synchronised duplicate of this. What I'd like to do is remove ALL the version history from the local…
kaese
  • 10,249
  • 8
  • 29
  • 35
870
votes
31 answers

Git asks for username every time I push

Whenever I try to push into my repo git asks for both username & password. I have no problem in re-entering my password each time but the problem is in entering username. I use https to clone my repository. So, how can I configure git so that it…
RanRag
  • 48,359
  • 38
  • 114
  • 167
863
votes
10 answers

Are Git forks actually Git clones?

I keep hearing people say they're forking code in Git. Git "fork" sounds suspiciously like Git "clone" plus some (meaningless) psychological willingness to forgo future merges. There is no fork command in Git, right? GitHub makes forks a little…
Brian
  • 8,791
  • 3
  • 15
  • 9
857
votes
15 answers

How to cherry-pick only changes to certain files?

If I want to merge into a Git branch the changes made only to some of the files changed in a particular commit which includes changes to multiple files, how can this be achieved? Suppose the Git commit called stuff has changes to files A, B, C, and…
Tobias Kienzler
  • 25,759
  • 22
  • 127
  • 221
857
votes
6 answers

When does Git refresh the list of remote branches?

Using git branch --all shows all remote and local branches. When does Git refresh this list? On pull/push? And how do I refresh it using Git Bash?
BendEg
  • 20,098
  • 17
  • 57
  • 131
843
votes
8 answers

Pull new updates from original GitHub repository into forked GitHub repository

I forked someone's repository on GitHub and would like to update my version with commits and updates made in the original repository. These were made after I forked my copy. How can I pull in the changes that were made in the origin and incorporate…
why
  • 23,923
  • 29
  • 97
  • 142
836
votes
10 answers

Remove directory from remote repository after adding them to .gitignore

I committed and pushed some directory to github. After that, I altered the .gitignore file adding a directory that should be ignored. Everything works fine, but the (now ignored) directory stays on github. How do I delete that directory from github…
janw
  • 8,605
  • 3
  • 18
  • 13
816
votes
32 answers

Git keeps prompting me for a password

I've been using Git for a while now, but the constant requests for a password are starting to drive me up the wall. I'm using Mac OS X and GitHub, and I set up Git and my SSH keys as instructed by GitHub's Set Up Git page. I've also added the…
Catherine
  • 13,588
  • 9
  • 39
  • 60
816
votes
23 answers

Can you get the number of lines of code from a GitHub repository?

In a GitHub repository you can see “language statistics”, which displays the percentage of the project that’s written in a language. It doesn’t, however, display how many lines of code the project consists of. Often, I want to quickly get an…
Hubro
  • 56,214
  • 69
  • 228
  • 381
814
votes
33 answers

SSH Key - Still asking for password and passphrase

I've been somewhat 'putting up' with Github always asking for my username and password when I clone a repository. I want to bypass this step because it is an annoyance within my workflow. I tried setting up an SSH key (which I successfully did)…
HelloWorld
  • 10,529
  • 10
  • 31
  • 50