Guest User

Untitled

a guest
May 27th, 2018
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. Git clone into an existing directory
  2. Here am explaining how to clone a remote git repo to an existing folder (assume this folder has some untracked files).
  3.  
  4. Go to the existing folder in terminal
  5. Run $git init
  6. Run $git remote add origin <your git repo url>
  7. Run $git fetch
  8. Run $git checkout -t origin/master (This works better for an empty directory, wont suit for a non-empty directory)
  9. Run $git reset origin/master if you have some files in your local existing directory.
  10. View the current repo status $git status
  11. Stage your file for commit $git add -f *.*
  12. Commit your files $git commit -m “message”
  13. Push your changes $git push origin master
Add Comment
Please, Sign In to add comment