在使用git来本地跟踪一个项目之后,我怎样才能把它添加到GitHub?
在使用git来本地跟踪一个项目之后,我怎样才能把它添加到GitHub?
在线创build存储库之后,GitHub会为您提供指导。
 cd到本地存储库的目录 
  git remote add origin whatever-address-my-repository is.git设置远程 
然后进行提交,并推送到主分支。
 git push -u origin master 
  README.md在本地README.md中创build一个README.md (对于GitHub  – *optional ) 
  2. git remote add origin <your_URL_for_github_repo.git> 
  (你可以通过inputgit remote -v来validation你是否git remote -v ,你可以看到<URL>.git为origin )。 
  3.通过git commit -a -m "<a message>" 
(重要!只有提交的文件将被推送到Github)
  4.现在通过git push -u origin master (如果你推动master分支)推送到GitHub。 
 您每次推送时都会需要密码(如果您使用的是https: :)进行克隆。 
在terminal中,input以下内容:
 git config --global credential.helper cache # Set git to use the credential memory cache 
要更改默认密码caching超时,请input以下内容:
 git config --global credential.helper 'cache --timeout=3600' # Set the cache to timeout after 1 hour (setting is in seconds) 
在这里,您将find有关如何创build存储库以及如何将其推送到Github上的步骤: http : //programertools.blogspot.com/2014/04/how-to-use-github.html