Skip to main content

Handling multiple git accounts in local PC

 మీకు 2 GitHub Accounts ఉన్నాయి:

  1. siddhuphp (Personal Account)

  2. Siddhartha-Esunuri_mmsrx (Office/Work Account)

ఇప్పుడు Git SSH ద్వారా connect అవుతున్నప్పుడు GitHub కి:

నేను Siddhartha-Esunuri_mmsrx account ని

అని చెబుతోంది.

అందుకే siddhuphp/bhoomatha private repo access చేయలేక:

Repository not found

అని వస్తోంది.


Visual Understanding

మీ దగ్గర రెండు ఇళ్ళు ఉన్నాయని అనుకోండి:

🏠 House A = siddhuphp
🔑 Key A

🏢 House B = Siddhartha-Esunuri_mmsrx
🔑 Key B

ప్రస్తుతం Git దగ్గర:

🔑 Key B

మాత్రమే ఉంది.

కానీ మీరు open చేయాలనుకుంటున్నది:

🏠 House A (siddhuphp)

అందుకే door open అవ్వడం లేదు.


Step 1: రెండు SSH Keys ఉండాలి

ప్రస్తుతం check చేయండి:

ls ~/.ssh

ఉదాహరణ:

id_ed25519
id_ed25519.pub

ఇది ప్రస్తుతం Office account key అయి ఉండవచ్చు.


Step 2: Personal Account కోసం కొత్త Key Create చేయండి

ssh-keygen -t ed25519 -C "siddhu.php@gmail.com" -f ~/.ssh/id_ed25519_siddhuphp

తర్వాత:

~/.ssh/id_ed25519_siddhuphp
~/.ssh/id_ed25519_siddhuphp.pub

create అవుతాయి.


Step 3: GitHub లో Add చేయండి

Public key చూడండి:

cat ~/.ssh/id_ed25519_siddhuphp.pub

Output:

ssh-ed25519 AAAAXXXXXXX....

మొత్తం copy చేయండి.

తర్వాత:

GitHub (siddhuphp account)

➡ Settings

➡ SSH and GPG Keys

➡ New SSH Key

➡ Paste


Step 4: SSH Config File

File:

C:\Users\Siddhartha\.ssh\config

Create చేయండి.

లోపల:

Host github-personal
    HostName github.com
    User git
    IdentityFile ~/.ssh/id_ed25519_siddhuphp

Host github-office
    HostName github.com
    User git
    IdentityFile ~/.ssh/id_ed25519

Visual Map

github-personal
       |
       |
       +----> id_ed25519_siddhuphp
                       |
                       |
                       +----> siddhuphp Account


github-office
       |
       |
       +----> id_ed25519
                       |
                       |
                       +----> Siddhartha-Esunuri_mmsrx Account

Step 5: Test

Personal

ssh -T git@github-personal

Output:

Hi siddhuphp!

Office

ssh -T git@github-office

Output:

Hi Siddhartha-Esunuri_mmsrx!

Step 6: Clone

Personal Repo

❌ ఇలా కాదు

git clone git@github.com:siddhuphp/bhoomatha.git

✅ ఇలా

git clone git@github-personal:siddhuphp/bhoomatha.git

Office Repo

git clone git@github-office:company/project.git

Future Usage

మీరు Personal Project (VizagUpdates, Bhoomatha, etc.) లో:

git config user.name "siddhuphp"
git config user.email "siddhu.php@gmail.com"

Office Project (inspiredge, amzut, etc.) లో:

git config user.name "Siddhartha-Esunuri_mmsrz"
git config user.email "Siddhartha.Esunuri@office.com"

ముందుగా ఈ command output పంపండి:

ls ~/.ssh

అప్పుడు మీ machine లో ప్రస్తుతం ఏ keys ఉన్నాయో చూసి exact config file నేను మీకు తయారు చేసి ఇస్తాను.

Comments

Popular posts from this blog

Data Types in Python

Data Types  In C# or Java, You need to declare a variable specify them integer, string, and decimal. But in Python no need to specify. We can declare variables like Example: C# or Java int age = 28; string Name = "Siddhu"; Example: Python age = 28 Name = "Siddhu" So, you don't need to declare variable types in python. This is an advantage in Python, But still have few Disadvantages too. Example: In my Python function def add_numbers(x,y): print(x+y) add_numbers(20,50) //Output: 70 add_numbers(20,"Something") //Error:"Traceback (most recent call last): File "C:/Users/siddhartha.e/PycharmProjects/siddhu-py/my1stpycode.py", line 8, in add_numbers(50,"Something") File "C:/Users/siddhartha.e/PycharmProjects/siddhu-py/my1stpycode.py", line 4, in add_numbers print(a + b) TypeError: unsupported operand type(s) for +: 'int' and 'str'" ...

Database and Migrations

Database and Migrations You can config Database in the .env file. By default, Laravel has MySQL configuration. For example, I configured my details DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=Laravel_tutorials DB_USERNAME=root DB_PASSWORD= So how it connects the database, In your root folder config/database.php file will read the .env file configuration. Migrations: Migrations are most likely a version control for your database. Advantages You can easily allow your team to modify database schema and share to everyone in the application No headache to add a new column in the database manually. This migration will help all teammates into one path. Now check with artisan command php artisan migrate php artisan migrate This command will create basic users,password_resets and migrations tables. Here migrations table will track of all migrates You can undo previous migration using rollback command php artisan ...

How to see Competitor ads on their Facebook pages

In any type of business, the organization always concentrate on their competitor's activities when it comes to competition. The first thing wants to what competitors doing, how they are getting leads or traffic. The same pattern is going when you are running Facebook Ads. If you want to know your competitor facebook strategy you will not see them on the newsfeed. Fortunately, you can see them in the following way and replicate their success on your Facebook Ads. Here am giving step by step. Follow each step  Step 1: Open your competitor facebook page and see the right side content of the page and click on see more button of the page transparency section as per below image Step 2: After opening the page you can see the page history and  Ads from this page. Click on Go to Ad library.  Step 3: Select the country that you want to see the Ads and see the Ads monthly.