Difference between revisions of "Git"

From UVOO Tech Wiki
Jump to navigation Jump to search
imported>Jeremy-busk
 
Line 2: Line 2:
  
  
 
+
```
 
git reset --soft HEAD~1  # Keep changes
 
git reset --soft HEAD~1  # Keep changes
  
 
git reset --hard HEAD~1  # Discard changes
 
git reset --hard HEAD~1  # Discard changes
 +
```
 +
ref: https://www.git-tower.com/learn/git/faq/undo-last-commit
  
  
ref: https://www.git-tower.com/learn/git/faq/undo-last-commit
+
```
 +
git clone git@github.com:jeremybusk/myrepo.git
 +
git checkout --orphan temp_branc
 +
git add -A
 +
git commit -m "add files"
 +
git -D master
 +
git branch -m master
 +
git push -f origin master
 +
```
 +
wipe history - you can use git clone as well or just copy files to new repo

Revision as of 20:30, 12 May 2020

Git Common Commands

git reset --soft HEAD~1  # Keep changes

git reset --hard HEAD~1  # Discard changes

ref: https://www.git-tower.com/learn/git/faq/undo-last-commit

git clone git@github.com:jeremybusk/myrepo.git
git checkout --orphan temp_branc
git add -A
git commit -m "add files"
git -D master
git branch -m master
git push -f origin master

wipe history - you can use git clone as well or just copy files to new repo