码迷,mamicode.com
首页 > 其他好文 > 详细

push local repo to git remote on creating a new branch

时间:2021-07-01 16:24:13      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:medium   ott   span   init   osi   border   add   eric   color   

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"

push local repo to git remote on creating a new branch

标签:medium   ott   span   init   osi   border   add   eric   color   

原文地址:https://www.cnblogs.com/mrlonely2018/p/14955467.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!