Question

I decided to learn how to use github about a month ago, and I went through the whole setup process for windows. It was fairly long from what I remember, but I stopped using it after that first day. I totally forgot where I started doing github projects (I mean what directory I started doing everything in) and I wanted to get back into fully understanding github, because I want to download someones project.

I went on to create another repo today and I got it settup successfully and I added a new README file from a test project I put in "My Documents" directory on Windows. Every time I went to push my latest commit using git push -u origin master it asked me for my username and password. Is there a way to stop this? I think I had it settup not to ask me anymore, but that was in my first directory where I started with github.

Or should I try to find out where I started github initially and do everything through there?

If my question was vague please let me know. This has taken me such a long time to comprehend, I just want to make sure I'm doing it the right way.

Was it helpful?

Solution

If you created a repo on github then go to that repo, you will see a http and a ssh address for it. Replace the current remote on your local repo with the ssh address from github. After adding this ssh remote address upon push you won't have to enter your information.

When you go to github, under repositories list you will see your repository your working on. If you were to click it it will open the reposirtory, you will see your files and all the information for it. In the middle above the files you have a http and a ssh address for the repository. Your local project is using the http address for a remote (remote is just the location to push the files). If you use the ssh address from github and replace your current remote with the new ssh address. Upon pushing to the ssh address github won't come back saying for your username and a password its a more secure way of pushing.

git remote rm origin // remotes current remote called origin

git remote add origin github ssh address goes here // adds a origin remote with the ssh address

git push origin master // pushing to master

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top