Categories
Git

การใช้งาน git กับโปรเจคที่มีอยู่แล้ว

  1. สร้าง Repository ใหม่
  2. $ cd /path/of/your/local/project
  3. $ git init
  4. $ git add .
    # Adds the files in the local repository and stages them for commit
  5. $ git commit -m ‘First commit’
    # Commits the tracked changes and prepares them to be pushed to a remote repository
  6. copy the remote repository URL.
  7. $ git remote add origin <remote repository URL>
    # Sets the new remote
    $ git remote -v
    # Verifies the new remote URL
  8. $ git push origin master
    # Pushes the changes in your local repository up to the remote repository you specified as the origin