Git pull deleted uncommitted changes

前端 未结 5 1878
有刺的猬
有刺的猬 2020-12-03 18:29

I just made a new repository on github. Starting with a folder full of files, the steps I did were:

git init
git add -A
git remote add origin ...

#Now pull          


        
5条回答
  •  生来不讨喜
    2020-12-03 19:31

    Since you never committed the files, no sorry. The steps you need to take are:

    git init
    git add .
    git commit -m 'Initial commit'
    git remote add origin ...
    git push origin master
    

    Remember, when in doubt, always commit. As long as you do that, you can always undo stuff with git.

提交回复
热议问题