Reputation: 63
I have a directory containing files of a git repository along-with some lib and bin files file. But there is no versioning system in the folder(no .git folder).
How do I setup git repository for my local use, which is in sync with remote git repository along with bin-files which already exist in local folder ?
Upvotes: 0
Views: 1150
Reputation: 2665
You can initialize a new git repository by typing git init
within your working directory.
This will create the .git
directory. Then you need to tell git where the remote is, so go to github.com and create a new repository.
When you create it go to your working directory and type:
git remote add origin https://github.com/user/repo.git
and replace user and repo with the appropriate fields.
The first thing you ll have to do is create your initial commit. Typically the initial commit is the README file:
touch README.md
git add README.md
git commit -m "Initial commit"
git push origin master
After you do that, your README file should appear on github.com under the repository you created.
The next step is push your current bin-files to remote. Assuming you want to track all of the files in your working directory do this:
git add .
which will add all of your files in version control.
Then commit your changes git commit -m "Your commit message"
and push them to the remote git push origin master
.
Upvotes: 2