Using Git with GitHub: `remote: Permission to username\project.git denied to myname.` - linux

I forked an existing project I'm trying to contribute to,
I'm trying to do it the simplest way possible. From a raspberry pi.
I changed email address and project names for simplicity
I don't understand why this doesn't work, the new repository is at https://github.com/username/project
Please help me understand what is missing, the instructions found online for github are not sufficient
pi#raspberrypi:~ $ git config --global user.name "username"
pi#raspberrypi:~ $ git config --global user.email "username#email.com"
pi#raspberrypi:~ $ git clone https://github.com/username/project
Cloning into 'project'...
remote: Enumerating objects: 23, done.
remote: Counting objects: 100% (23/23), done.
remote: Compressing objects: 100% (18/18), done.
remote: Total 1450 (delta 9), reused 16 (delta 5), pack-reused 1427
Receiving objects: 100% (1450/1450), 2.28 MiB | 0 bytes/s, done.
Resolving deltas: 100% (1019/1019), done.
pi#raspberrypi:~ $ cd project
pi#raspberrypi:~/project $ git add --all
pi#raspberrypi:~/project $ git commit -am "mychange"
[master 1732397] mychange
20 files changed, 2613 insertions(+), 2248 deletions(-)
create mode 100644 newfile.cpp
pi#raspberrypi:~/project $ git push
Username for 'https://github.com': username#email.com
Password for 'https://username#email.com#github.com':
remote: Permission to username/project.git denied to myname.
fatal: unable to access 'https://github.com/username/project/': The request ed URL returned error: 403

The username requested by GitHub should not be an email address. (username#email.com)
It should be your GitHub user account name.
Unless you have 2FA activated, in which case, the username remains your GitHub account, but your password would be a PAT (Personal Access Token)

Related

git clone deletes everything in my project

I am facing an issue with git.
I was cloning my git repo with git clone
However, i get this error message.
and the project folder is empty.
When i search about this issue online, people suggested git reset
but i got an error saying
error: invalid path 'nodejs/blog_mvc/public /style.css'
fatal: make_cache_entry failed for path 'nodejs/blog_mvc/public /style.css'
I am not getting what this error message is telling me to do.
Cloning into 'WebApps'...
remote: Enumerating objects: 488, done.
remote: Counting objects: 100% (488/488), done.
remote: Compressing objects: 100% (272/272), done.
remote: Total 5294 (delta 201), reused 426 (delta 142), pack-reused 4806
Receiving objects: 100% (5294/5294), 10.40 MiB | 2.91 MiB/s, done.
Resolving deltas: 100% (1361/1361), done.
error: invalid path 'nodejs/blog_mvc/public /style.css'
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'
and as it suggested, i did git restore --source=HEAD :/
and i got this error.
error: invalid path 'nodejs/blog_mvc/public /style.css'
when i checked git status, everything in the project was deleted.
But on my github account, everything is still there as usual.
Can someone tell me what is going on?
I am not sure if the best solution is rollback to the previous commit and start from there or if i could figure out in a better way, please let me know. that would help me.
Thank you in advance.

Git push command getting stuck after 100%

I am on branch fsp .I have used Following commands:
git pull origin master
git add .
git commit -m "message"
and then
abc#abc689:~/Workspace2/M-Egal(fsp)$ git push origin fsp
Counting objects: 103, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (87/87), done.
Writing objects: 100% (103/103), 20.31 KiB | 0 bytes/s, done.
Total 103 (delta 34), reused 0 (delta 0)
After this it is not responding. It is stuck at this point can anyone help ?
I have ssh connection with account and have used these steps several time before also.
The issue has been resolved after I switched the Internet connection from local cafe's Wi-Fi to mobile data

GitHub cloning - unable to access attributes from another linux account

I have a repository on GitHub. I tried to to connect to this repository from my laptop with Debian. I want to connect from one of my linux accounts: php-ocsclient. But I did not succeed.
The strange thing is that the error message said that there was no access to /home/gameboy/.config/git/attributes. Why does it need the access to another account?
I purged git completelly from my laptop an reinstall but this strange thing remained.
php-ocsclient#localhost:~/public_html$ git clone https://github.com/trzczy/php-ocsclient.git
Cloning into 'php-ocsclient'...
remote: Counting objects: 47, done.
remote: Total 47 (delta 0), reused 0 (delta 0), pack-reused 47
Unpacking objects: 100% (47/47), done.
Checking connectivity... done.
warning: unable to access '/home/gameboy/.config/git/attributes': Brak dostępu
php-ocsclient#localhost:~/public_html$
How to fix it?

Gitolite refuses to accept commits to gitolite-admin.git

I am following this tutorial to install a gitolite server on my Debian PC. Once that works, I intend to connect to it from a virtual machine, to simulate client connection.
$ cd ~/ssh
$ ssh-keygen glite
$ sudo apt-get install gitolite3
$ export GL_LIBDIR=/home/default/bin/lib
$ export GL_BINDIR=/home/default/bin
$ gitolite setup -pk /home/default/.ssh/glite.pub
$ cd ~/projects
$ git clone ../repositories/gitolite-admin.git
# make some changes
$ git push origin master
Counting objects: 4, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 413 bytes | 0 bytes/s, done.
Total 4 (delta 0), reused 0 (delta 0)
remote: WARNING: Use of uninitialized value $repo in concatenation (.) or string at /home/default/bin/lib/Gitolite/Conf/Load.pm line 251, <DATA> line 1.
remote:
remote: FATAL: invalid repo ''
remote: error: hook declined to update refs/heads/master
To ../../repositories/gitolite-admin.git/
! [remote rejected] master -> master (hook declined)
error: failed to push some refs to '../../repositories/gitolite-admin.git/'
So some variable $repo is empty inside some python script. What am I missing?
Perhaps your local user has only read-persission ?
check the entry in your
../repositories/gitolite-admin/conf/gitolite.conf
there should be an entry coresponding to your glite.pub file name in keydir.
repo gitolite-admin
RW+ = glite

How to remove big files from local repo for successful push

I've just created local repo and commited all files from the root dir.
But GiutHub failed to receive a push to remote hub cause of giant file limitations:
[srv50213#cl10-m htdocs]$ git push -u origin master
Counting objects: 17875, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (17645/17645), done.
Writing objects: 100% (17875/17875), 413.33 MiB | 3.69 MiB/s, done.
Total 17875 (delta 5496), reused 0 (delta 0)
remote: warning: File 20140924.srv50213_tarex.dump is 82.14 MB; this is larger than GitHub's recommended maximum file size of 50 MB
remote: error: GH001: Large files detected.
remote: error: Trace: ac437f9f600e8418e6bf5065e472204c
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File htdocs/2014-10-09-10:40-site-archive.zip is 227.12 MB; th exceeds GitHub's file size limit of 100 MB
To git#github.com:igorsavinkin/tarex.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#github.com:igorsavinkin/tarex.git'
after that I tried to remove those files from local repo but failed, according to this instruction:
[srv50213#cl10-m htdocs]$ git rm --cached 20140924.srv50213_tarex.dump
fatal: pathspec 'htdocs/20140924.srv50213_tarex.dump' did not match any files
[srv50213#cl10-m ~]$ git rm --cached 20140924.srv50213_tarex.dump
rm '20140924.srv50213_tarex.dump'
[srv50213#cl10-m ~]$ git rm --cached htdocs/2014-10-09-10:40-site-archive.zip
fatal: pathspec 'htdocs/2014-10-09-10:40-site-archive.zip' did not match any files
[srv50213#cl10-m ~]$ git rm --cached 2014-10-09-10:40-site-archive.zip
fatal: pathspec '2014-10-09-10:40-site-archive.zip' did not match any files
Even though I amend:
[srv50213#cl10-m ~]$ git commit --amend -CHEAD
[master 35dc27d] remove file1.txt
6 files changed, 1249 insertions(+), 2072 deletions(-)
delete mode 100644 20140924.srv50213_tarex.dump
delete mode 100644 20140924.srv50213_yupe.dump
delete mode 100644 htdocs/2014-10-09-10:40-site-archive.zip
when I want to push it again I get the same result:
[srv50213#cl10-m ~]$ git push -u origin master
Counting objects: 17875, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (17645/17645), done.
Writing objects: 100% (17875/17875), 413.33 MiB | 3.63 MiB/s, done.
Total 17875 (delta 5499), reused 0 (delta 0)
remote: warning: File 20140924.srv50213_tarex.dump is 82.14 MB; this is larger than GitHub's recommended maximum file size of 50 MB
remote: error: GH001: Large files detected.
remote: error: Trace: 7abab285207c27988ceddd39f61f25cd
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File htdocs/2014-10-09-10:40-site-archive.zip is 227.12 MB; this exceeds GitHub's file size limit of 100 MB
To git#github.com:igorsavinkin/tarex.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#github.com:igorsavinkin/tarex.git'
How to resolve this quest with 2 big files stored/stuck in the local repo?
When I want to remove them from git by git rm --cached 2014-10-09-10:40-site-archive.zip should an instance of it be in the corresponding folder of working copy?

Resources