GIT - mokdevel/ArmaReforger_snippets GitHub Wiki

Basics

  • Clone main
git clone git://github.com/name/repo.git
  • Clone specific branch
git clone -b branch_name --single-branch git://github.com/name/repo.git
  • Update
git pull
  • Sync to a specific branch
git clone git://github.com/yourname/yourrepo.git
git remote add upstream git://github.com/name/repo.git
git fetch upstream
git pull upstream branch_name
  • Commit code
git commit -a
git push

Change user

  • Create a personal access token. Go to Settings->Developer settings->Personal access tokens->Generate new token
  • In Windows credential manager, remove the existing user from 'Generic Credentials'
  • Add a generic credential
Internet or network address: git.https://github.com
username and your access token as the password
  • Change the details for git:
git config user.name your_username
git config user.email your_emailaddress

Troubleshooting

  • Error fatal: unable to connect to github.com: github.com[0: 140.82.121.4]: errno=Unknown error
    • Fix git config --global url.https://github.com/.insteadOf git://github.com/
⚠️ **GitHub.com Fallback** ⚠️