DEV Community

cienc
cienc

Posted on

Github contribution workflow

1.Fork the repository

2.Clone the forked repository & Configure upstream

git clone FORKED-REPO
cd FORKED-REPO
git remote add upstream ORIGINAL-REPO
git remote -v
Enter fullscreen mode Exit fullscreen mode

3.Configure environment for the project and install dependencies
Depending on the project, change sample.env to .env
If Node.js project, install packages by running npm install or yarn

4.Make a git branch & Make commits

git checkout -b BRANCH-NAME
git commit -m "KEYWORD #ISSUE-NUMBER - commit message"
Enter fullscreen mode Exit fullscreen mode

5.Sync the repository & Push

git fetch upstream
git checkout master
git merge upstream/master
git checkout BRANCH-NAME
git rebase -i master
git push origin master
git push --set-upstream origin BRANCH-NAME
Enter fullscreen mode Exit fullscreen mode

6.Make Pull Request
from BRANCH-NAME -> Original Repo's master

7.Remove the branch

git branch -d BRANCH-NAME
git push origin --delete BRANCH-NAME
Enter fullscreen mode Exit fullscreen mode

Top comments (0)