search

Home  >  Q&A  >  body text

git usage problems

Push the code to coding, use the following three commands when submitting for the first time,

# git add .
# git commit -m"init project"
# git push

What I want to ask is, every time I change the code in the future, will I execute these three commands when I want to submit it?

滿天的星座滿天的星座2813 days ago631

reply all(6)I'll reply

  • phpcn_u1582

    phpcn_u15822017-05-02 09:32:12

    Generally yes, if you delete a file it should be git add -A, I can’t remember clearly

    reply
    0
  • 仅有的幸福

    仅有的幸福2017-05-02 09:32:12

    add can be merged into commit -am "xxx" without new files.
    In addition, it is best to git status before each commit.

    reply
    0
  • 给我你的怀抱

    给我你的怀抱2017-05-02 09:32:12

    Yes, but if you want to delete a file you still need git rm一下。还有添加.gitignore的话得另外add。建议时常git status.

    reply
    0
  • 黄舟

    黄舟2017-05-02 09:32:12

    Actually, you’ll know once you try it, don’t be afraid

    reply
    0
  • 给我你的怀抱

    给我你的怀抱2017-05-02 09:32:12

    Yes. But don't use specific filenames like git add .,使用 git add filepath/filename.py.

    reply
    0
  • 淡淡烟草味

    淡淡烟草味2017-05-02 09:32:12

    If you only modify the file, the first two can be merged into one git commit -a -m ""

    reply
    0
  • Cancelreply