How to commit & push selected files but not all in Git

前端 未结 2 1837
礼貌的吻别
礼貌的吻别 2021-01-20 02:53

I have a git repo with two branches: develop and master. I work mostly at develop and when files are ready (sometimes not so sticky to

相关标签:
2条回答
  • 2021-01-20 03:17

    When you make a commit, all the staged file are included in the commit. If you wish to exclude certain files from a commit, unstage those files first.

    I'm not sure how to do that with the Git UI you are using, but there should be a screen or something to manage which files with changes are staged and which aren't.

    0 讨论(0)
  • 2021-01-20 03:21

    Use terminal to commit selected file : like: you have 100 files (10 type)

    git add *.* all file

    git add *.jpg all jpg file

    $ git add . # add to index only files created/modified and not those deleted

    $ git add -u # add to index only files deleted/modified and not those created

    you can use source tree for all git work.

    0 讨论(0)
提交回复
热议问题