Skip to content

Latest commit

 

History

History
34 lines (33 loc) · 718 Bytes

File metadata and controls

34 lines (33 loc) · 718 Bytes

Git Lib

=========
Basic git lib.

  1. My code is ready to be pushed
cd existing-project
git init
git add --all
git commit -m "Initial Commit"
git remote add origin ssh://git@10.10.10.10/one_directory/one_repo.git
git push -u origin master
  1. My code is already tracked by Git
cd existing-project
git remote set-url origin ssh://git@10.10.10.10/one_directory/one_repo.git
git push -u origin --all
git push origin --tags
  1. Remove untracked files from the working directory
   git clean -f
   git reset --hard
  1. Undoes a committed snapshot
   git revert
  1. Error: cannot lock ref 'refs/remotes/origin...' -> clean up local repo
  git gc --prune=now
  git remote prune origin