Search code examples
gitandroid-studiogithubgit-commitgit-push

Committing existing project to git and github


I have a fairly large android studio project and I now want to commit the entire project to git and then to github but I'm stuck! I know how to add a file to the staging area and committing it or committing all modified files but how do I commit an entire project to git instead of committing files singly?

Thank you for your help in advance! :)


Solution

    1. Create your repository on github
    2. Init (locally) your repository by typing in your terminal git init (you should change your working directory to project main folder)
    3. Perform a git add .
    4. Perform your first commit git commit -m "First project commit"
    5. Tell git where your remote repository is and what's the source name git remote add origin <remote repository url provided by github>
    6. Push your branch on remote git push -u origin master