I overwrote and lost some important scripts and would like to setup version control to protect my stuff. I've used git before, and am familiar with commands, but don't understand where I would put my "remote" repository on an install set up on my own machine---the place I push/pull to. I don't intend to share or access remotely, I just want a little source control for my files.

I followed the instructions here for setting up my staging area: https://stackoverflow.com/questions/4249974/personal-git-repository

But where do I put git "remote" repo on purely local git setup? How does the workflow work then?

On the command in the above:

git remote add origin ssh://myserver.com:/var/repos/my_repo.git

Where should I put/name something like this? If I have multiple different projects, would they go in different places? I'm running 11.10.


You don't need to set up a remote repository if you are not sharing or accessing your code remotely.

You would have to set up a "remote" repository if you were using a centralised version control system like Subversion, but not for git.

You can just use git in the directory you are working on.

If later you want to push it to another machine, either for sharing / access / backup, then you can use github.com or set your own server up. All you need is ssh access and you get that with most web hosting packages.

  • Oh, that's cool. So, I can just "git commit." But how do I revert? If it isn't remotely published, I can't check out, right? How do I revert previous errors? – Mittenchops Mar 25 '12 at 1:03
  • 1
    You can checkout from the current directory to an older version. So you want to roll back to the commit called 3c144bff8e7d1486792364d7c5fd80c286d095b3, for example, you would do git checkout 3c144bff8e7d1486792364d7c5fd80c286d095b3 to roll back to that position. Or use the -b flag to check out the older version in a new branch. There is nothing special about the remote copy, you can branch locally. There is a book : progit.org/book that explains more. – Richard Holloway Mar 25 '12 at 16:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.