push local repo to git remote on creating a new branch

时间:2021-07-01 16:24:13   收藏:0   阅读:0

current status:

We have a remote repository and a local project repository with no git configured. We want to push to remote and create new branch.

 

Procedures:

  1. Set up ".gitignore" file.
  2. "git init" in local repo.
  3. git checkout -b <new-branch>
  4. git add .
  5. git config --global user.email "you@example.com" (use --local if you only want this takes effect on this particular repo)
    git config --global user.name "Your Name"

  6. git commit -m "commit-msg"
  7. git remote add <remote-name> <remote-url> (usually the remote-name is set to ‘origin‘)
  8. git push -u <remote-name> <new-branch>
  1. git commit -m "commit-msg"

评论(0)
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!