Git FAQ

  • How to get all code from remote to local

git branch -r | grep -v '\->' | sed "s,\x1B\[[0-9;]*[a-zA-Z],,g" | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all
 

#  push to new remote
git remote set-url origin git@github.com/xxxxx.git

# Push code
git push --all origin 
git push origin --tags
 
  • Error clean secret by bfg

    • err:

      bad object refs/remotes/origin/HEAD fatal: failed to run repack

    • ans:

      master -> main issue

cat .git/refs/remotes/origin/HEAD
git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main

Be the first to comment

Leave a Reply

Your email address will not be published.


*