Follow following steps to import you current files to git and start version controlling :
- Signup and create a repository.
- Install git for windows from git-for-windows.github.io
-
Open git bash and make configuration changes by typing below commands:
- git config –global user.name "your username"
- git config –global user.email "Your Email"
-
Now type following commands to import the newly created repository to your computer
- git clone https://github.com/your-user-name/your-repository-name.git (this url is found on you git page under 'Clone or download' button.
- pwd (to get working directory – Now copy your files to the folder of your repository in working directory)
- cd your-repository-name (to enter in the folder which was created while cloning the respository)
- git init (Initialize the local directory as a Git repository)
- git add . (Add the files in your new local repository. This stages them for the first commit)
- git commit -m 'First commit' (what you have changed – just type it as it is for now)
- git remote add origin your-repository-url
- git remote -v (Verifies remote – may ask you to login)
- git push origin master (Push the changes in your local repository to GitHub in your master branch)
- If you are already using git then use only 4,8,9 steps.
- Now you have Imported your current project files to git.
Happy versioning.