如何使用Java中的文件中的特定行号来读取特定的行?(How to read a specific line using the specific line number from a file in Java?)
在Java中,有没有从文件中读取特定行的方法? 例如,读取第32行或任何其他行号。
In Java, is there any method to read a particular line from a file? For example, read line 32 or any other line number.
原文:https://stackoverflow.com/questions/2312756
最满意答案
$HOME/.gitconfig
是git的全局配置。
有三个级别的配置文件 。cat $(git rev-parse --show-toplevel)/.git/config
(由bereal 提及 )是您的本地配置,您所克服的repo的本地配置。
您也可以在您的回购中输入:
git remote -v
并查看是否有任何远程名为“origin”的文件。
如果没有,如果该远程(默认情况下克隆repo时创建),则可以重新添加:
git remote add origin url/to/your/fork
OP提到:
做
git remote -v
给出:upstream git://git.moodle.org/moodle.git (fetch) upstream git://git.moodle.org/moodle.git (push)
所以'
origin
'缺少:引用你的叉子。
请参见“ github中原点和upstream
的区别 ”
$HOME/.gitconfig
is your global config for git.
There are three levels of config files.cat $(git rev-parse --show-toplevel)/.git/config
(mentioned by bereal) is your local config, local to the repo you have cloned.
you can also type from within your repo:
git remote -v
And see if there is any remote named 'origin' listed in it.
If not, if that remote (which is created by default when cloning a repo) is missing, you can add it again:
git remote add origin url/to/your/fork
The OP mentions:
Doing
git remote -v
gives:upstream git://git.moodle.org/moodle.git (fetch) upstream git://git.moodle.org/moodle.git (push)
So '
origin
' is missing: the reference to your fork.
See "What is the difference betweenorigin
andupstream
in github"
相关问答
更多-
首先,检查您的原点是否通过运行设置 git remote -v 这应该会向您展示项目的所有推/抓遥控器。 如果返回时没有输出,则跳至最后的代码块。 验证远程名称/地址 如果返回显示您已设置遥控器,请检查遥控器的名称是否与您在命令中使用的遥控器相匹配。 $git remote -v myOrigin ssh://git@example.com:1234/myRepo.git (fetch) myOrigin ssh://git@example.com:1234/myRepo.git (push) # th ...
-
致命的:不是Git仓库(fatal: Not a Git Repository)[2024-02-19]
尝试 git clone ssh://name@ipaddress:port/~/Git/myapp.git (重要的是~路径组件)。 Try git clone ssh://name@ipaddress:port/~/Git/myapp.git (the important bit is ~ path component). -
远程源已经存在于“git push”到新的存储库中(Remote origin already exists on 'git push' to a new repository)[2023-06-18]
您收到此错误,因为“origin”不可用。 “起源”是不是命令的一部分的惯例。 “origin”是远程存储库的本地名称。 例如你也可以写: git remote add myorigin git@github.com:myname/oldrep.git git remote add testtest git@github.com:myname/oldrep.git 请参阅手册: http://www.kernel.org/pub/software/scm/git/docs/git-remote.htm ... -
Git推送错误:“origin似乎不是git仓库”(Git push error: “origin does not appear to be a git repository”)[2022-04-12]
因为在che的答案中已经提到了添加远程部分,我相信你仍然缺少。 关于您在本地USB驱动器上添加远程的编辑。 首先,如果您希望将存储库作为共享存储库,即可以推/拉/获取/合并等等,那么您必须拥有一个“裸存储库”。 要创建裸/共享资源库,请转到您所需的位置。 在你的情况下: $ cd /Volumes/500gb/ $ git init --bare myproject.git 有关创建裸存储库的更多信息,请参阅此处 一旦您在所需位置中设置了一个可用的存储库,就可以将其作为远程文件添加到工作副本中。 $ ... -
$HOME/.gitconfig是git的全局配置。 有三个级别的配置文件 。 cat $(git rev-parse --show-toplevel)/.git/config (由bereal 提及 )是您的本地配置,您所克服的repo的本地配置。 您也可以在您的回购中输入: git remote -v 并查看是否有任何远程名为“origin”的文件。 如果没有,如果该远程(默认情况下克隆repo时创建),则可以重新添加: git remote add origin url/to/your/fork ...
-
“git rebase origin”与“git rebase origin / master”(“git rebase origin” vs.“git rebase origin/master”)[2021-09-11]
这是一个更好的选择: git remote set-head -a origin 从文档: 使用-a,查询远程以确定其HEAD,然后$ GIT_DIR / remotes // HEAD设置为相同的分支。 例如,如果远程HEAD指向下一个,则“git remote set-head origin -a”将设置$ GIT_DIR / refs / remotes / origin / HEAD为refs / remotes / origin / next。 这只有在refs / remotes / orig ... -
您具有scp style方式指定存储库略有错误的语法 - 它必须是: [user@]host.xz:path/to/repo.git/ ...你可以在git克隆文档中看到。 你应该使用URL: git@skarp.beanstalkapp.com:/gittest.git 即在你使用的URL中,你错过了:冒号) 要更新您可以做的原始URL: git remote set-url origin git@skarp.beanstalkapp.com:/gittest.git You've got the ...
-
非常坦率的: git remote rm origin 对于filter-branch问题 - 只需将--prune-empty添加到您的过滤器分支命令中,它将删除任何实际不包含您所生成的repo中的更改的修订版本: git filter-branch --prune-empty --subdirectory-filter path/to/subtree HEAD Fairly straightforward: git remote rm origin As for the filter-branch ...
-
如何修复'git remote add'上的“致命:远程来源已经存在。”(How to fix “fatal: remote origin already exists.” on 'git remote add'?)[2023-09-02]
首先删除远程origin ,然后再次添加路径。 $ git remote rm origin $ git remote add origin另一种方法:设置origin's url而不是添加。 $ git remote set-url origin Remove the remote origin first, then add again with the path. $ git remote rm origin $ git remote add ori ... -
正如git告诉你的那样: The current branch master has no upstream branch. 因此,git不知道你的remote-repository哪个分支应该推送你的更改。 我无法重现这一点; 如果我执行您的步骤,则设置上游分支。 但是,为了解决这个问题,你可以完全按照git告诉你的那样做: git push --set-upstream ../remote-repository.git master 。 这告诉git默认情况下,您当前正在处理的分支(您的本地master ...