2

I am very new to github. I was trying to pull a branch from a repository which contains some php code.

I used git clone <url> then I used git checkout <branchname> to switch to a specific branch.

Since I am using Github for Windows, the files are stored in Github folder of My Documents. Now I want to test the code and make some changes to it in my localserver. So should I copy paste the project folder in the www directory of my wamp folder? Or should I do something else? And if after copying the folder, if I want to commit any changes, what command should I use to push?

user2510555
  • 817
  • 2
  • 8
  • 13
  • Yeah, if you copy it into your web directory that should work. – jraede Jun 21 '13 at 22:38
  • Can't the Github client be configured to store repos someplace else? Otherwise, try using symlinks. – Xaqq Jun 21 '13 at 22:38
  • Just copy the parent folder (the one that .git is inside of) and then your whole repo will move. I'm not familiar with windows command line but you would just run `git add .`, `git commit`, type in your message, then `git push` – jraede Jun 21 '13 at 22:39
  • @jraede and if I want to make some changes to the code and then commit it, then what should I do? – user2510555 Jun 21 '13 at 22:40
  • Okay, I will try that. Thank you :) – user2510555 Jun 21 '13 at 22:40

1 Answers1

0

Github for Windows does mention in the help page that:

GitHub for Windows is optimized to work with GitHub remotes — but if you wish to use a non-GitHub remote, it will work just fine. Set the remote manually in the settings tab and everything else should work as expected. You can also drag in repositories from the file system and GitHub for Windows will respect the configuration of the origin remote.

So you can pull from a non-GitHub repo, like I did in this answer or as illustrated in this blog post.

But from your local clone, you cannot easily push to another repo (like one in your wamp folder for instance)

it does not support multiple Git remotes and it will only work with the origin remote.
If you wish to push & pull to other remotes, we suggest you use the command line client that is included with the application.

An alternative to command-line would be to use a GUI which does support multiple remote, like SourceTree.

Or you can clone the GitHub repo from the command-line directly in the right folder, and then declare that local repo in your GitHub for Windows app.

Or you could create a virtual host that has a DocumentRoot of the Github folder of My Documents (meaning you don't have to move anything, and can keep using GitHub for Windows as you were).

Community
  • 1
  • 1
VonC
  • 1,042,979
  • 435
  • 3,649
  • 4,283