Skip to main content

Posts

Showing posts with the label git

Handling multiple git accounts in local PC

 మీకు 2 GitHub Accounts ఉన్నాయి: siddhuphp (Personal Account) 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 ...

What to do after .gitignore file updated?

After creating a  .gitignore  file in your repository and setting patterns to match files which you do not want Git to track, Git starts tracking repository files and respecting the patterns set in the  .gitignore  file after you run the  git add  command (For example  git add . ). The problem is that if we later make some changes to the  .gitignore  file and then just run the  git add  command again, the changes made in the  .gitignore  file  will not take effect . For example if you later set in the  .gitignore  file that you want Git to start tracking a file which you previously set to be ignored, the file will still be untracked if you just run the  git add .  command. This is because, the  git cache  needs to be cleared. I usually just do this with the  git rm -r --cached .  then after I run the  git add .  command to apply the  .gitignore  changes. Thin...