开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜