Source Tree account switch - atlassian-sourcetree

I am trying to push to a repository under user account 'starhunter1' using source tree. Since initially while installing source tree i might have used 'starhunter2' account, hence while trying to push i am receiving a permission error. How can i switch the account to that of 'starhunter1'. I tried uninstalling and re-installing source tree but it does not help and still throws the below error.
git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --tags origin v1:v1
remote: Permission to starhunter1/TestJenkins.git denied to starhunter2.
fatal: unable to access 'https://github.com/starhunter1/TestJenkins.git/': The requested URL returned error: 403
Pushing to https://github.com/starhunter1/TestJenkins.git
Completed with errors, see above.

For each repository in Source Tree you have the possibility to set a specific user.
Select your repo tab, then click "Settings", then "Advanced".
There you will see a checkbox saying "Use global user parameter".
Uncheck this box and you should be able to manually define the user.

Related

sam build when deployed in github now fails

Last week I managed to successfully deploy an AWS Lambda function (verified in the AWS console). This morning, I can no longer update the Lambda function. After deleting the Lambda function and pushing changes again, the Lambda was still not able to be created. Instead I get the following traceback:
Build Failed
Error: PythonPipBuilder:ResolveDependencies - The directory '/github/home/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/github/home/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Invalid requirement: 'Warning: The lock flag'
In the workflow deploy file:
- name: Build Lambda image
run: sam build
I don't know exactly what has changed to now cause this error. I tried the flag --use-container which successfully moves on the next step of deploying the Lambda image, however there I now encounter further error messages. I'd like to understand why before adding the --user-container flag, I didn't encounter this error. Is this --use-container flag necessary when not using the sam cli?
Further info
Building via the sam cli tool works, not when pushed via the Github actions workflow.

Fatal unable to access 'https://github.com/': The requested URL returned error: 403 - despite following all solutions?

I deleted my keychain credentials and generated a Personal Access Token on Github.
Once prompted for password in terminal, I entered my PAT (though I do not see the typed input on the screen) - I get an error every time. I went through the published solutions on Stack and nonetheless cannot push my root folders to the new repository on Github.
Is there anything else I can try or another way to upload the full folder with sub folders and file at once? I have GitHub Desktop but cannot see any changes in the history even though I cloned the repository.
My command line path:
...-MBP (project-name) % git push -u origin main
Username for 'https://github.com': (my username)
Password for 'https://(my username)#github.com':
remote: Permission to (my username)/to-do-list.git denied to (my username).
fatal: unable to access 'https://github.com/(my username)/(project-name).git/': The requested URL returned error: 403
I also got that same error.. what i did to resolve was to go back to setting, then generate another Personal Token Access Token, then below i selected the scopes, or permissions, to grant this token(this step i had skipped previously). Then clicked on Generate Token and the when i used the token again it worked.

Error Cloning/pushing git organizational repository in dbeaver(git integration)

I am getting an error when trying to clone an organization git repository in dbeaver.
I am guessing its an authentication issue or something.
Any insights appreciated.
Note:
My credentials are correct.
I am using https protocol.
I am able to clone/push using git desktop without error.
My user account has admin role to this repository.
I am able to clone/push a non organizational repository in dbeaver.
ERROR: " ... git-upload-pack not permitted on ..."
ERROR Screenshot:

Managing multiple GIT ssh keys

Having some issues with maintaining too many SSH keys in the same computer lately.
I have created two SSH keys in my computer for UserA(Company) and UserB(Personal). Both the ID's are created using different email ID
I am able to pull and push the code changes for UserA
But UserB is where I face trouble to push my code.
I am able to pull the code for UserB(Where repo is different than UserA)
While pushing the code I get the following error
ERROR: Permission to UserB/xxxxxx.git denied to UserA.
Please make sure you have the correct access rights
and the repository exists. ```
Feel bit strange to me. Can someone help me this ?
Starting from Git 2.3.0 you can use below command
GIT_SSH_COMMAND='ssh -i private_key_file' git clone user#host:repo.git
Solved !!
Created Gitconfig for personal and work using the following link,
https://medium.com/#trionkidnapper/ssh-keys-with-multiple-github-accounts-c67db56f191e
Sometimes you have the problem of too many keys stored in the ssh-agent.
Then the server refuses the connection after it offering too many keys.
This can be solved by force ssh to use only one specific key.
GIT_SSH_COMMAND='ssh -o IdentityAgent=none -i private_key_file' git <cmd>

How do I clone Github data to Amazon EC2?

I am new to both Git and Amazon EC2.
I want to clone my Github code to Amazon EC2 directly.
For that I have referred to the following URLs:
http://thelucid.com/2008/12/02/git-setting-up-a-remote-repository-and-doing-an-initial-push/
http://deductiveblog.in/2013/05/19/deploy-to-amazon-ec2-using-git/
How to push to git on EC2
I've performed the necessary changes suggested in the above URLs, but am still not able to get my data on Amazon EC2.
By following the above suggested steps, I can see one directory - but it does not display the data in it that I have in git & in my local.
So what should I do to clone all data in Amazon EC2?
I also want to know one other thing - is it possible that I can put my files directly in /var/www directory without creating .git?
Now in this, I am getting an error Permission denied (publickey). Fatal the remote end hung up unexpectedly.
For that I have checked my ssh keys as well and add it to github. I have a file authorized_keys for key and I have added the same key in github, but still it gives me a Permission denied error.
Can anyone give any suggestions how to resolve this?
You can just use the git clone command from your ec2 instance from the directory you want the repo cloned to.
git clone git://github.com/ryanb/railscasts-episodes.git
of course you need to alter the url part to your repo, this will create a folder with the files inside named after the repo in the current directory. If you want to clone the files inside the repo into the current directory do:
git clone git://github.com/ryanb/railscasts-episodes.git .
The Full Stop (.) or dot indicates the current directory in Unix.