Author : MD TAREQ HASSAN | Updated : 2023/02/19

Overview

Overview of forking and cloning a Github repository

(A) Fork repository

Fork Github Repository Step 1

Fork Github Repository Step 2

Fork Github Repository Step 3

(B) Clone repository

Clone Github Repository Step 1

Clone Github Repository Step 2

Clone Github Repository Step 3

Clone Github Repository Step 4

(C) Add upstream repository to your local

We need to add upstream repository to our local (only once)

# Check upstream
git remote -v

# Add upstream repository to your local 
git remote add upstream <upstream repository url>

(1) Make changes and commit

Make the changes you need in your local repository (i.e., modify, add, delete etc.):

Now commit using following commands:

git status

git add .
git status

git commit --message "<message here>"
git status

(2) Sync to upstream repository

Now sync using following commands (BTW, did you add upstream to your local? git remote -v):

# get info: local <- upstream
git fetch upstream

# check that you are on the main branch
git branch
git checkout main

# merge: local <- upstream
git merge upstream/main

Git upstream merge commit comment

Git upstream merge commit success

(3) Push to remote repository

After syncing to upstream, we need to push local changes to remote repository

git status

git pull

git push

(4) Create pull request

Create Github Pull Request Step 1

Create Github Pull Request Step 2

Create Github Pull Request Step 3

Create Github Pull Request Step 4

Create Github Pull Request Step 5

Create project in visual studio

Create project in Visual Studio Step 1

Create project in Visual Studio Step 2

Create project in Visual Studio Step 3

Create project in Visual Studio Step 4

Create project in Visual Studio Step 5

Create project in Visual Studio Step 6

Create project in Visual Studio Step 7

Create project in Visual Studio Step 8

Create project in eclipse

Create project in Eclipse Step 1

Create project in Eclipse Step 2

Create project in Eclipse Step 3

Create project in Eclipse Step 4

Create project in Eclipse Step 5

Create project in Eclipse Step 6

Create project in Eclipse Step 7

Create project in Eclipse Step 8

Create project in Eclipse Step 9

Create project in Eclipse Step 10

Create project in Eclipse Step 11

Create project in Eclipse Step 12

Create project in Eclipse Step 13

Create project in Eclipse Step 14