FaltuTech.Club : Fane of Advanced Logical Thriving Utopian Technical Club

Import your current project files to git with git bash

Follow following steps to import you current files to git and start version controlling :

  1. Signup and create a repository.
  2. Install git for windows from git-for-windows.github.io
  3. Open git bash and make configuration changes by typing below commands:
    1. git config –global user.name "your username"
    2. git config –global user.email "Your Email"
  4. Now type following commands to import the newly created repository to your computer
    1. 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.
    2. pwd (to get working directory –  Now copy your files to the folder of your repository in working directory)
    3. cd your-repository-name (to enter in the folder which was created while cloning the respository)
    4. git init (Initialize the local directory as a Git repository)
    5. git add . (Add the files in your new local repository. This stages them for the first commit)
    6. git commit -m 'First commit' (what you have changed – just type it as it is for now)
    7. git remote add origin your-repository-url
    8. git remote -v (Verifies remote – may ask you to login)
    9. git push origin master (Push the changes in your local repository to GitHub in your master branch)
  5. If you are already using git then use only 4,8,9 steps.
  6. Now you have Imported your current project files to git.

Happy versioning.