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
58,367
questions
5532
votes
26
answers
4.8m
views
How to determine the URL that a local Git repository was originally cloned from
I pulled a project with several forks on GitHub, but forgot which fork it was. How do I determine which fork I pulled?
4741
votes
32
answers
1.3m
views
How do I update or sync a forked repository on GitHub?
I forked a project, made changes, and created a pull request which was accepted. New commits were later added to the repository. How do I get those commits into my fork?
3419
votes
46
answers
2.6m
views
How to add images to README.md on GitHub?
Recently I joined GitHub. I hosted some projects there.
I need to include some images in my README File. I don't know how to do that.
I searched about this, but all I got was some links which tell me ...
2110
votes
28
answers
1.2m
views
Is there a way to cache https credentials for pushing commits?
I recently switched to synchronizing my repositories to https:// on GitHub (due to firewall issues), and it asks for a password every time.
Is there a way to cache the credentials, instead of ...
2058
votes
21
answers
1.8m
views
How can I remove a commit on GitHub? [duplicate]
I "accidentally" pushed a commit to GitHub.
Is it possible to remove this commit?
I want to revert my GitHub repository as it was before this commit.
1985
votes
47
answers
1.7m
views
Download a single folder or directory from a GitHub repository
How can I download only a specific folder or directory from a remote Git repository hosted on GitHub?
Say the example GitHub repository lives here:
[email protected]:foobar/Test.git
Its directory ...
1930
votes
11
answers
560k
views
How to find a deleted file in the project commit history?
Once upon a time, there was a file in my project that I would now like to be able to get.
The problem is: I have no idea of when have I deleted it and on which path it was.
How can I locate the ...
1893
votes
31
answers
2.0m
views
Git push requires username and password
I cloned a Git repository from my GitHub account to my PC.
I want to work with both my PC and laptop, but with one GitHub account.
When I try to push to or pull from GitHub using my PC, it requires ...
1709
votes
51
answers
2.1m
views
Message "Support for password authentication was removed."
I got this error on my console when I tried to use git pull:
remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/...
1568
votes
10
answers
1.7m
views
Create a tag in a GitHub repository
I have a GitHub repository and I need to tag it.
I created a tag in a shell using the following command:
git tag 2.0
git tag
>>> 2.0
The tag does exist locally, but does not appear on GitHub....
1509
votes
16
answers
1.2m
views
GitHub relative link in Markdown file
Is there a way to create a URL anchor, <a>, link from within a Markdown file, to another file within the same repository and branch (aka a link relative to the current branch)?
For example, in ...
1230
votes
54
answers
2.3m
views
Git push results in "Authentication Failed"
I have been using GitHub for a little while, and I have been fine with git add, git commit, and git push, so far without any problems. Suddenly I am having an error that says:
fatal: Authentication ...
1228
votes
24
answers
862k
views
How to install an npm package from GitHub directly
Trying to install modules from GitHub results in this error:
ENOENT error on package.json.
Easily reproduced using express:
npm install https://github.com/visionmedia/express throws error.
npm ...
1122
votes
55
answers
1.8m
views
GitHub Error Message - Permission denied (publickey)
Anybody seen this error and know what to do?
I'm using the terminal, I'm in the root, the GitHub repository exists and I don't know what to do now.
> git push -u origin master
Permission denied (...
1091
votes
16
answers
825k
views
Calculate RSA key fingerprint
I need to do the SSH key audit for GitHub, but I am not sure how do find my RSA key fingerprint. I originally followed a guide to generate an SSH key on Linux.
What is the command I need to enter to ...
1061
votes
70
answers
3.4m
views
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....
1036
votes
12
answers
1.9m
views
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 ...
964
votes
17
answers
1.0m
views
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 ...
963
votes
8
answers
1.2m
views
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?
910
votes
15
answers
498k
views
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 ...
909
votes
38
answers
1.6m
views
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/...
899
votes
14
answers
910k
views
How to draw checkbox or tick mark in GitHub Markdown table?
I am able to draw checkbox in Github README.md lists using
- [ ] (for unchecked checkbox)
- [x] (for checked checkbox)
But this is not working in table. Does anybody know how to implement checkbox or ...
898
votes
19
answers
340k
views
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 ...
894
votes
23
answers
790k
views
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 ...
892
votes
5
answers
695k
views
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?
886
votes
31
answers
728k
views
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 ...
881
votes
8
answers
373k
views
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 ...
866
votes
10
answers
378k
views
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 ...
864
votes
10
answers
361k
views
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 ...
855
votes
36
answers
977k
views
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 ...
842
votes
33
answers
571k
views
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 ...
836
votes
76
answers
1.5m
views
Pushing to Git returning Error Code 403 fatal: HTTP request failed
I was able to clone a copy of this repo over HTTPS authenticated. I've made some commits and want to push back out to the GitHub server. Using Cygwin on Windows 7 x64.
C:\cygwin\home\XPherior\Code\...
834
votes
6
answers
383k
views
Pull request vs Merge request
What is the difference between a Pull request and a Merge request?
In GitHub, it's a Pull Request while in GitLab, for example, it's a Merge Request. So, is there a difference between both of these?
809
votes
42
answers
534k
views
Multiple GitHub accounts on the same computer?
Trying to work on both my actual "work" repos, and my repos on GitHub, from my computer.
The work account was set up first, and everything works flawlessly.
My account, however, cannot seem ...
807
votes
10
answers
218k
views
What is the difference between GitHub and gist?
What is the purpose of gist and how is it different from regular code sharing/maintaining using GitHub?
799
votes
11
answers
457k
views
How to state in requirements.txt a direct github source
I've installed a library using the command
pip install git+git://github.com/mozilla/elasticutils.git
which installs it directly from a Github repository. This works fine and I want to have that ...
794
votes
15
answers
864k
views
Delete forked repo from GitHub
I'm starting with git and GitHub and there's a project I'm watching on GitHub. I unintentionally clicked to fork it. Now it appears as a new project to me.
I have some doubts about it:
I know if ...
782
votes
11
answers
1.7m
views
Updating a local repository with changes from a GitHub repository
I've got a project checked locally from GitHub, and that remote repository has since had changes made to it. What's the correct command to update my local copy with the latest changes?
779
votes
3
answers
87k
views
GitHub satanically messing with Markdown - changes 666 to DCLXVI
My GitHub repository has nothing but a readme in it. In this readme, locally I wrote this:
Factoids:
- There are about six different ways to do everything in Forked.
- There are actually six ...
766
votes
21
answers
189k
views
Why is a git 'pull request' not called a 'push request'?
The terminology used to merge a branch with an official repository is a 'pull request'. This is confusing, as it appears that I am requesting to push my changes to the official repository.
Why is it ...
749
votes
53
answers
538k
views
gpg failed to sign the data fatal: failed to write commit object [Git 2.10.0]
I followed few articles over the pretty attributes on Git 2.10 release note. Going through which upgraded the git to 2.10.0 and made changes to global .gitconfig resulting as follows -
[filter "lfs"]...
737
votes
20
answers
415k
views
How to add screenshot to READMEs in github repository?
Is it possible to place a screenshot in README file in a GitHub repository? What's the syntax?
735
votes
18
answers
813k
views
Git push existing repo to a new and different remote repo server?
Say I have a repository on git.fedorahosted.org and I want to clone this into my account at github to have my own playground aside from the more "official" repo on fedorahosted.
What would be the ...
703
votes
5
answers
336k
views
How can I reference a commit in an issue comment on GitHub?
I find a lot of answers on how to reference a GitHub issue in a git comment (using the #xxx notation).
I'd like to reference a commit in my comment, generating a link to the commit details page?
698
votes
17
answers
1.5m
views
How do I create a folder in a GitHub repository?
I want to create a folder in a GitHub repository and then add files to that folder.
How do I achieve this?
697
votes
37
answers
1.0m
views
GitHub: invalid username or password
I have a project hosted on GitHub. I fail when trying to push my modifications on the master. I always get the following error message
Password for 'https://[email protected]':
remote: Invalid username ...
692
votes
34
answers
472k
views
View markdown files offline [closed]
Is there a way to display .md files offline so we know what it will look like once it's uploaded in Github? I'm referring to showing the README.md file as it would come out in Github, and not as for ...
678
votes
71
answers
1.2m
views
Git Push ERROR: Repository not found
I am having a very strange problem with git and github. When I try and push, I am getting:
git push -u origin master
ERROR: Repository not found.
fatal: The remote end hung up unexpectedly
I added ...
678
votes
22
answers
759k
views
Remote origin already exists on 'git push' to a new repository
I have my project on GitHub at some location, [email protected]:myname/oldrep.git.
Now I want to push all my code to a new repository at some other location, [email protected]:newname/newrep.git.
I used ...
673
votes
5
answers
202k
views
How to update a pull request from forked repo?
So I first forked a repo and then made a commit to that forked repo. I then opened a pull request. The pull request listed all the changes I wanted.
After reviewing my pull request, there were a ...