DEV Community

phoebehala
phoebehala

Posted on • Updated on

To collaborate on GitHub by fork

How we worked on the group project:

  1. Came up with ideas
  2. Talked about the structure and library we could use
  3. Set our goal: Leaning how to collaborate with Git by fork
  4. Learned and Practiced the workflow of GitHub fork
  5. Set a timeline and Used "Trello" to trace the progress
  6. Assigned tasks to each one
  7. Had several meeting to make sure everyone worked well and were on the same page
  8. Wrapped up

Noted down the workflow of GitHub fork:

Step 1. Fork the repo
Step 2. Clone the forked Repository

cd folderName
git clone https://github.com/Your-GitHub-Username/github-practice
Enter fullscreen mode Exit fullscreen mode

step 3. Create my feature branch

git checkout -b myOwnBranchName
Enter fullscreen mode Exit fullscreen mode

step 3.1 Work on my part and push to my remote repository

git add . 
git commit -m “......”
git push origin myOwnBranchName(feature)
Enter fullscreen mode Exit fullscreen mode

Step 4.1 Check if the develop branch has ever changed
(Do it every time I resume my work)

git fetch upstream 
git checkout main
git merge upstream/develop
Enter fullscreen mode Exit fullscreen mode

Image description

Step 4.2. Push to my own remote repository

git push origin main
Enter fullscreen mode Exit fullscreen mode

Step 5 Merge synchronized main to my local feature branch which I am currently working on

git switch(or checkout) yourOwnBranchName(feature)
git merge main
Enter fullscreen mode Exit fullscreen mode

if merge conflict happens, go step6.

Step 6. Manage the conflict
Image description

step 6.1. Send a pull request
Image description

step 7. Push to my own remote repository after merge

git push origin myOwnBranchName(feature)
Enter fullscreen mode Exit fullscreen mode

Top comments (0)