Full Steps to start a git project

Hey guys! Here are some tips for you to start a git project from creating a repository to running the project as a team.

Full Steps to start a git project

  1. Create a remote Gitee repository.
  2. Create new branches as you wish. (Generally, you should create several branches as many as your team member)
  3. Create a local folder to retrieve initial files from the remote Gitee repository.
  4. Open the local folder with VS Code.
  5. Use "Ctrl + Shift + ` " to open terminal in VS Code.
  6. Next, follow the steps to gitify your local folder.
    • git init - initialized empty Git repository
    • git remote add origin https://gitee.com/xxxx/xxxx.git - add remote repository
    • git pull origin <remote_branch_name> (like git pull origin dev_example) - pull and obtain remote code to local folder
    • git checkout -b <local_branch_name> (NOTICE: the <local_branch_name> should be exactly the same as remote one. Like git checkout -b dev_example) - create local branch to associate with remote one
  7. So far, you have clone the project to your local folder which is connected to the remote repository as well.
  8. To synchronize local change to remote one, please use these steps below.
    • git add "newChageFile.xx" - add new file
    • git commit -m "new change explanation" - add change explanation
    • git push origin <your_branch_name> (like git push origin dev_example) - push your change to your remote branch
  9. Until now, for a common developer in a team, these commands are far enough.

If you are going to merge members' change to the project, you should follow the additional steps below.

  1. git checkout master - go to master branch
  2. git pull origin <member_branch_name> (like git pull origin dev_example) - get member's change
  3. git push origin master - update this member's change to the project
  4. Repeat steps 1-3 until all members' changes have been updated.
According to my limited level, this article might have some problems. Please feel free to contact any other skilled team members once you get some puzzle. Hopefully, it helps.
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容