How to push a single file in a subdirectory to Github (not master)

前端 未结 7 1694
傲寒
傲寒 2020-12-23 13:56

I have changed a single file in a subdirectory of my repository and I want to push just that file to Github.

I\'ve made a small change to one file, and I don\'t wa

7条回答
  •  心在旅途
    2020-12-23 14:52

    When you do a push, git only takes the changes that you have committed.

    Remember when you do a git status it shows you the files you changed since the last push?

    Once you commit those changes and do a push they are the only files that get pushed so you don't have to worry about thinking that the entire master gets pushed because in reality it does not.

    How to push a single file:

    git commit yourfile.js
    git status
    git push origin master
    

提交回复
热议问题