When do I need to do “git pull”, before or after “git add, git commit”?

前端 未结 6 891
忘了有多久
忘了有多久 2020-12-22 16:14

What is the right way?

git add foo.js
git commit foo.js -m \"commit\"
git pull
git push

Or

git pull
git add foo.js
git comm         


        
6条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-22 16:59

    I think git pull --rebase is the cleanest way to set your locally recent commits on top of the remote commits which you don't have at a certain point.

    So this way you don't have to pull every time you want to start making changes.

提交回复
热议问题