How to apply changes of the repository permissions in gitolite? - gitolite

write access was added in gitolite.conf By push is error "DENIED by fallthru<>(or you mis-spelled the reponame)"

You need to clone /push in gitolite-admin repo

Related

Pushing a respository I initialised with git init inside another repository to github

I am currently doing course called fullstackopen for which I created a repository on Github called fso and cloned it locally using ssh. Inside fso, I created directories for different parts(part1, part2) and created react projects inside them (using create-react-app). I pushed them to github without any problems.
For part3, the course asked to create a new repository for the backend(node js). I created this repo inside fso/part3 using git init and initialised a node app called phonebook. Now, when I tried to push it to Github, I got this:
enter image description here
So, I added my github repo using:
git remote add origin
After this when I tried to push again, I was prompted for my username and password but support for password authentication has been removed. I tried pushing using personal access tokens and got this:
enter image description here
Can I run the following in my part3/phonebook (phonbook-backend) directory?
git pull origin master git push origin master
I'm not sure if this would work, I dont want to lose my work.
Edit: i tried git pull origin main --allow-unrelated-histories and got this
pushing after this results in the same error
this is what my directory structure looks like locally. Im trying to push part3 to my github repo
Your last error is 'updates were rejected because the remote contains work'
This happens when your repository gets initialized with additional files like README or GITIGNORE. To resolve this, first you need to pull your changes from server, so you can use below command:
'git pull origin main --allow-unrelated-histories'
Then you can push your changes to server using below command:
'git push -f origin main'

Sourcetree existing repo has no brances and cannot create one

I have an existing repo which I connected to my gitlab via ssh
I am just trying to create my branch in sourcetree so that i push my changes there but in getting an error "not a valid object name master"
is there any part that i skipped because my created repository cant create new branches? thanks for reading any help will be great.
TLDR: created and linked via gitlab repo in sourcetree with an existing one, cant create branch to push
Check first if you are creating your branch from an empty repository: there should be at least one commit.
If the repository is not empty, check if:
your remote GitLab repository expects a default branch 'main'
your local repository uses master as its main branch
If it is the case, rename your local branch
cd /path/to/local/repository
git branch -m master main
And make sure any future local repository starts with main:
git config --global init.defaultbranch main
Try again your branch creation in SourceTree.

git push, pull, clone with no response

When I run git push, pull, clone none of them works.
I get following error when i'm trying to push or pull or clone a repository
fatal: unable to access 'https://github.com/myUsername/myRepo/':
Operation timed out after 0 milliseconds with 0 out of 0 bytes
received
What can cause such an issue? Where and what should I check to find out what is causing this problem?
You are cloning the wrong url. Git repo urls are in the form of:
https://github.com/username/repository.git
With that url you are trying to clone the repository public (or private, depending on your account) front page.
It should be some thing like below:
git clone https://github.com/myUsername/myRepo.git
According this link, When switching branches and doing a submodule update git sometimes messes up the submodule status without you having touched it.
So following codes fixes the issue
git submodule init
git submodule update

Gitolite Configure post-push hook and perform operation on committed content

I am using the Gitolite to create the git repo.
I have requirement that when user push something to repo it must have some specific file (eg. .md file) otherwise don't let push the code.
So now I need to configure a post-push hook and do some operation on pushed content.
Can any one please help me to do the same?
First, I would not recommend gitosis (old and obsolete).
Second, this is a job for a VREF (update hooks in Gitolite lingo).
You can use in that VREF a diff --name-only or diff --name-status:
git diff --name-only <sha-old> <sha-new>
(See shell explained)
If the list doesn't include your .md file, you would exit with a non-zero status, and the git push would be denied.

git repo description is not updating

In my gitolite.conf file I've added a bunch of config gitweb.description lines but I dont see the changes when I view gitweb. If I look in the repos on the server the description hasn't been updated.
How do I get them to sync up?
Normally, the update happens on pushing that gitolite-admin repo back to the gitolite server, through triggers.
You can manually trigger them on the server to see if that makes any difference:
gitolite trigger POST_COMPILE
Make sure the description is within a repo section:
repo myrepo
config gitweb.description = some description
Double check the content of the projects.list file, and that your GIT_HTTP_BACKEND is well set.

Resources