开发者

what is the ideal way to edit a single file on github?

开发者 https://www.devze.com 2023-04-05 20:10 出处:网络
I currently have a running rails application. One other programmer meddled with things like the .gitignore files and committed files that I don\'t should be committed.

I currently have a running rails application. One other programmer meddled with things like the .gitignore files and committed files that I don't should be committed.

I, myself, am already handling the project to him. I wouldn't want mess up if he was doing anything really important. But I need to modify a file and won't want to push his files to the server.

What can I do to just edit that file and push that file to th开发者_JAVA百科e staging server without pulling his code?


You just need to create another branch from the last commit you want

git checkout -b branch-name 0451d7fc32

This will switch to an old commit and create a branch. Push this and pull this from your staging with:

git pull origin branch-name

Then switch to it.

git checkout branch-name
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号