git permission denied on pull/push - windows

I'm trying to create a project using git, but after cloning repository from github in phpstorm i can commint/push/pull only once. After that I see the message about permissions denied on files: COMMIT_EDITMSG or FETCH_HEAD.
I set .git folder visible and not only readable and i can do one commit/push/pull and after permissions denied again. And .git folder become hidden and only readable.
In windows I set full access for .git folder and it files, but got same effect.
Cloning through phpstorm or console have no difference.
ps: Sorry for my english. And some names and title maybe not correct because I have russian windows.
pps: i've scanned my PC and found no viruses.

You can't push to other people's repositories unless they give you permission.
If you want to push the code back to github, fork it first on github, then do a "git clone" with the URL of your own fork, not the original repository.
You should then be able to do pushes to your fork.
Make sure you have configured your public SSH key(s) in the github account settings.
After pushing your changes to your fork, you can do a pull request on github so the original project can merge your changes into their repository.

I had a similar problem. First i tried identified myself in IDEA Jetbrains via userName / password and Test Connection confirmed the correctness of my input. But the comit and the push, etc. only worked with other applications. Not with Jetbrains. but now i used token variant. and that works. :)
https://youtrack.jetbrains.com/oauth?state=%2Fissue%2FWI-41232

Related

Issue with pushing my changes to my repository

I have just set up my computer with a clean install. My project code etc was already on a secondary D drive so is unaffected.
I installed Git and TortoiseGit.
I now try to do a Push and get an error about a UriFormatException. Then it shows the password window:
I can log into my repositories OK on BitBucket web page. So what have I done wrong?
The whole point is that yesterday I was able to communicate these repositories with bitbucket.
Now I can't. ChuckieAJ is correct.
But something is wrong on my setup of TortoiseGit etc.
All I know is that I can no longer push anything to my bitbucket account. It is all messed up. :(
This helped me out:
https://help.cloudforge.com/hc/en-us/articles/215243143-Configure-TortoiseGIT-client-to-work-with-SSH-keys-on-Windows?mobile_site=true
I had to click on Git / Remote in each repository and correct the URL links to the new SSH locations and use the new Putty Key path.
Probably, ChuckieAJ should not be part of the url -- at least not with ChuckieAJ# in front of it but probably with bitbucket.org/ChuckieAJ/yourproject or something.

Setting up GitHub - resulted in massive files on local drive

I set up my first gitHub SSH key this morning and am having a few problems.
The first is that there is now a hidden .git file on my computer that is taking up 55.6GB of space.
I followed the instructions here to set up the SSH Key:
https://help.github.com/articles/generating-an-ssh-key/
When I tried to create a new repository I’m getting errors that say “Xcode can’t verify the identity of a repository hosted on “github.com”
At this point I’m extremely confused where I went wrong. Is it possible to delete all SSH Keys and anything local that is taking up space on my machine and start over?
File size screen: https://www.dropbox.com/s/chgyaxewl78zrik/git_file_Size.png?dl=0
Error on upload: https://www.dropbox.com/home/_IOS?preview=Screen+Shot+2016-10-03+at+6.17.29+PM.png
At this point, I would like to delete and SSH keys on my machine and basically start fresh. If anyone has insight on how these massive files were formed please let me know, and if there are any tips on how to make sure this doesn’t happen are greatly appreciated.
Git is a version control system. It allows you to control the changes on your files by making snapshots of how all your files (and then only changed files) look at the moment of the commit. You can read more how this awesome tool works here.
The problem is you have initialized or cloned a git repo on your home folder and git probably made a snapshot of all your files. You can safely rm -rf ~/.git to get rid of the repo.
Edit: Maybe you'll want to erase the code that was in the repo too. Next time you initiate a git repo, do it in a separate/isolated folder.

How to restore files git deleted during clone

After working on something for a while, I thought I should put it in a git repo. Using gitlab, I created a new repo and cloned it from the command line onto my Windows 7 machine. This created a folder with a .git folder in it. I then copied all the files I'd been working on into the folder. I then noticed that the command line where I had cloned the repo was asking for a password. I entered the wrong password a couple of times and stupidly hit ctrl+c. Next thing I knew, the folder with all my files was gone. It is not in the recycle bin. Is there any way to restore these files?
Unfortunately, they are lost and git won't help you here. You should rely on file recovery tools to help you recover the files (long, hard and boring process) if you can afford to rewrite your code from scratch.
Buy I could tell you what you did wrong with git and what you should have done to never have been in such a situation...
You should have done :
1. Create a local repository in your project directory with 'git init'.
2. Do as much development and commits as you want (but at least one...). You are now protected against file deletion!
3. Once you think it worth to be shared, like you do, create the repository in gitlab.
4. Add the gitlab repository as a remote in your local repository.
5. Push the history to the gitlab central repository.
Like that, you should have avoided all the risky action you did and your work is secured at all times.
Standard methods for removed file restoration apply:
Suspend any user operations on the HD (don't create/copy/remove files). This will increase your chances when trying to restore.
Check if you have the file copies/originals in other folders. You mentioned that you had copied them previously into git folder. May you have them in the original directory?
Do you have any backup system running (like Crashplan, etc) ? Check if you have a backup of the files
If nothing of the previous helped proceed to the undelete operation - use dedicated utilities like this one for ex.: http://www.ntfsundelete.com

How to create a git repository on a shared windows machine which all developers can push to

I have created a bare Git repository on a shared windows machine on a local area network. I am experiencing a problem in which nobody else but me is able perform a push operation. When trying to sync with or push to the remote repository using the Visual Studio 2013 Git tools, other users receive an error reading "Opening repository: .The following errors were reported during push: refs/heads/master, Failed to rename lockfile to '/refs/heads/master': Access is denied." There seem to be a lot of similar questions about creating a shared repository on stack overflow though none of them have given me the right solution for my problem. One thought is that I may need to create a repository user group, perhaps based on our domain user groups, though I do not have any idea how to do this with Git on Windows and have not found any resources for instructions as of yet.
You can share the folder that contains the bare git repository, and just add those Windows users as people who can read and write to those folders. After making a folder "shared" Windows should tell you what the network path should be. Then it's a simple git clone file:////MACHINE_NAME/path/repo.git.

Github "Failed to publish this branch" error on windows

I'm new to git, and I just downloaded it yesterday. As a test for my first online (not local) repo, I committed a useless text file and then hit publish. After a short while, I got this very non-descriptive error:
So I know that I can't publish to this branch. There's only one and it's the master branch. Does anyone have any further information on what might be causing this error?
As a side note, my partner has successfully uploaded files to the same repo, but I haven't gotten any sort of indication that this has happened. Does this mean I'm not connected to the repo properly in some way? I was the one who set it up!
In Windows, right click on your repository --> click on open a shell here
You will see a command prompt.
type git push in it. (been aware after seeing SimonBoudrias comment)
The command prompt will suggest you to type some other command or shows an error.
If the command prompt suggest you to type something else, then type that. It will work.
If the command prompt shows error then please post the detailed error here.
Info: You might want to check this app
Open a shell in your repository. Then type
git push --set-upstream origin master --force
This will upload your local repo to the server no matter what, overwriting if necessary. This should only be done if you're sure nobody else is publishing to your repo at the moment.
I had the same issue as mentioned here, but none of the solutions mentioned above helped. Then I found this answer which talks about Proxy settings, which is exactly why GitHub was failing to commit on my machine. Hope this helps somebody else
To set up your Proxy Settings, you just need to use this command:
git config --global http.proxy
http[s]://userName:password#proxyaddress:port
To fix it, open a command prompt in the repo. For example by pressing the cog in the top right in the repo view and selecting "open a shell here".
In the command prompt, type git push --set-upstream origin master
Either this will work, or it will say ! [rejected] master -> master (fetch first)
If this happens, type git pull origin master (add --rebase if you like)
In GitHub the Publish-button might still be visible instead of the sync button. If this is the case, simply restart GitHub.
What this does is resetting the default remote branch for your local branch to master.
Maybe you just forget type something to the Description area when you commit your files. Someone like me only type the summery.So make sure you have fill in the Summary and Description when you commmit.
Just type something to the Description textarea when commiting. Then i published successfully.
what i do?
1 Go to the folder of your repository in Windows Explorer
2 delete the file your want to publish. and recreat it.
3 Open GitHub For Windows and click on your Repository .then you will find Uncommitted changes on left side.
4 type your Summary
5 type your Description.(the most important step !!!)
6 commit to master
7 Hit Publish and You should be successful.
This is my first answer. so i have no 10 reputation to post an image......hope help you.
Another possibility is a temporary unavailability of GitHub servers.
I'm just having the same problem and confirmed that it's a server issue: https://status.github.com/
Sample screenshot:
I had this error since I forgot to add remote repository link in the GitHub desktop. Once added the correct repo link, everything worked.
Try to commit your changes before publishing. It helps me to solve same problem.
I too had the same problem while publishing my GitHub page. I solved it in the following way.
$git push
I got the error message here. Then I made a pull request
$git pull
After this I made the push again
$git push
Here I got the solution
Note:I use GitHub for windows,And finally published the page using it
I was getting that error because I hadn't properly configured my name and email. On the page where you do that (in the native app, at least), you'll see that the page opens with your name and email already filled in but that doesn't mean that they're saved as settings. In order to save them, you have to press the check mark in the bottom left corner of that screen.
I got this error because I already had created a repository with the same name on github, and then created it locally and tried to commit it. The solution was to delete it from github, then commit it from the local client. Now they're in sync.

Resources