How to update a file in remote repo, without cloning that repo first?

前端 未结 6 1863
天命终不由人
天命终不由人 2020-12-14 07:39

Is there a way to push a commit to a remote git repo, without first making a local clone of that repo?

I have a valid URL for the remote repo, I know the path of the

6条回答
  •  萌比男神i
    2020-12-14 08:01

    Yes you can push a new version using tagging

    follow this steps

    in your new project root

    1. git init
    2. git remote add origin git@github.com:yourusername/yourpoject
    3. git tag -a v2.0 -m 'version 2.0'
    4. git add .
    5. git commit -m "New Version 2.0 :rocket:"
    6. git push -u origin v2.0

    now you have a new branch called v2.0 with your new project and your master branch stays untouched. After that if you wan't you can change your default branch in your github project settings.

提交回复
热议问题