Turn existing folder into git repository
First of all let me write about initial conditions:
- I have folder on my computer’s disk with code
- I have a new empty repository on github
Our great plan consists of following points:
- Navigate to project folder:
- $ cd /path/to/project
- Add files to the repository:
- $ git init
- $ git add . (don’t forget about point sign)
- $ git commit -m “first commit”
- After we have to connect to our remote repository:
- $ git remote add origin https://github.com/mygitaccount/mynewproj.git
- Push files on remote server and create new branch “master” on our new github repository
- $ git push -u origin master
- Last thing, type the following command:
- $ git push
Now all your files in github repository, congratulations!
If you want to check current state type
$ git status – it shows active branch, and other useful information.
$ git branch – shows all available branches
Leave a Reply
You must be logged in to post a comment.