Skip to content

Latest commit

 

History

History
30 lines (22 loc) · 602 Bytes

git-notes.md

File metadata and controls

30 lines (22 loc) · 602 Bytes

New Branch (Github)

git checkout -b [branchname] git push origin [branchname]

Clone Remote Branch

git remote show origin git checkout -b [localRepoName] [origin/repo]

Delete local

git branch -d [local]

Delete Remote

git push origin --delete [branchname] git remote prune origin //Gets rid of old remote branches that is still referenced locally

Set Remote URL

git remote set-url origin [https://...]

Reset to Remote Repo

// Save work first git commit -am "Saving work" git branch my-saved-work

// Reset git fetch origin git reset --hard origin/master

Undo

git reset --hard