我在我的工作区中有一个Java项目,我试图将其推送到GitHub。如何查看GitHub上的存储库
我是第一次使用Git用户,并没有创建GitHub帐户。
这些是我遵循的步骤。
- 从源代码文件夹
最初,我确实:
git --bare init
再次我跑
git init
命令:git init
创建远程仓库:
git remote add origin ssh://ravi.kiran.com/home/sai/workspace/Sai
然后,我把我的本地文件版本控制之下。
git add .
git commit -a -m 'initialize repo'
然后我把我的全局配置:
结果的git config -l
git config --global user.email "[email protected]"
git config --global user.name "ravikirantest"
:
[email protected]:~/workspace/Sai/src$ git config -l [email protected] user.name=ravikirantest core.repositoryformatversion=0 core.filemode=true core.bare=false core.logallrefupdates=true remote.origin.url=ssh://ravi.kiran.com remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
请告诉我如何在GitHub中查看我的存储库!
在此之后,我甚至创建了一个GitHub帐户,其中包含上述指定的 电子邮件和用户名,但我无法在github.com上查看我的文件。
更新部分
[email protected]:~/workspace/Sai/src$ git push origin master
Username for 'https://github.com': ravikirantest
Password for 'https://[email protected]':
To https://github.com/ravikirantest/Chandrayan.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/ravikirantest/Chandrayan.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
[email protected]:~/workspace/Sai/src$
我知道你正在试图帮助我,我正在关注你的帖子,并试图做同样的事情,但我感到一个问题。 – Pawan
如果这是您第一次推到新的GitHub仓库,我想知道您的初始尝试是否会让您感到困惑?即也许从一个干净的石板重新开始? – harunahi