Menu

Post image 1
Post image 2
1 / 2
0

How to Find users who don't follow you back in Github

DEV Community: productivity·Adhishatanaka·1 day ago
#pSm2ZnQR
#dev#following#followers#user#login#sort
Reading 0:00
15s threshold

Adhishatanaka

Here is a quick GitHub CLI trick to easily find users who don't follow you back (unfollowers). It fetches your following and followers lists via the GitHub API, compares them, and outputs the names of those who haven't returned the favor. Combining CLI tools with APIs for small automations like this is a great way to cut down on repetitive tasks! 😎

💻 macOS / Linux:

comm -23 \
<(gh api user/following --jq '.[].login' | sort) \
<(gh api user/followers --jq '.[].login' | sort)

Enter fullscreen mode Exit fullscreen mode

🪟 Windows (PowerShell):

$following = gh api user/following --jq '.[].login' | Sort-Object
$followers = gh api user/followers --jq '.[].login' | Sort-Object

Compare-Object $following $followers | Where-Object {$_.SideIndicator -eq "<="}

Enter fullscreen mode Exit fullscreen mode

Read More