我想使用git推送一些文件,但是当我添加一些想要推送的文件并提交时,显示如下:
git commit -m "Form-View-Controller-Models-Seeder-Route-Team"
On branch dev
Changes not staged for commit:
`modified: app/Http/Controllers/Auth/RegisterController.php`
`modified: app/Http/Controllers/Auth/ResetPasswordController.php`
即使不是我的
如何解决github上被拒绝的只有一个文件的推送替换远程推送?
尝试此但没有任何成功
例如消息
! [rejected] main -> main (fetch first)
error: failed to push some refs to 'https://github.com/abdulbadii/MatrixMultiplier'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usua
我只更改了两个文件,它们是我想要推送到Github的唯一文件。我已经添加了我想要的两个文件,并提交了带有注释的更改。然而,当我推送时,我得到了以下结果:
git push
To github.com:TinsleyBridgeGroup/TBL-bending-presses.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:TinsleyBridgeGroup/TBL-bending-presses.git
我正在尝试推送新的更改,但我有一个冲突的文件。在尝试推送之后,我得到了以下错误:
Merge the remote changes (e.g. 'git pull') before pushing again. See the
'Note about fast-forwards' section of 'git push --help' for details.
好的,所以我们需要使用git pull。我尝试使用git pull,然后收到以下错误:
error: Your local changes to the following files
我很困惑,为什么我不能在我的存储库的远程分支中推送我的更改--我使用git branch -a实现了当前的设置和分支
*(HEAD detached from 008fds4)
develop
master
remotes/origin/HEAD -> origin/master
remotes/origin/develop
remotes/origin/master
每次我试图按git push origin develop提交时,终端都会显示该develop does not appear to be a git repository。请告诉我我的分支的现状,以及如何移动指针或指向我
mohamed@mohamed:~/Projects/skyrocket$ git status
On branch dev/SMMWEB-36
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: config/puppet
我正在尝试编写一组bash命令,这些命令将:
保存当前更改
签出和提取源分支
签出和拉出目标分支
将目标分支与源分支合并
将更改推送到目标分支
签出初始分支
把变化从藏物中拿出来
首先,我不知道这是否是使用bash脚本合并两个分支的正确方法。
问题是我很难把名字藏起来。这是我的剧本:
while getopts "s:t:" option; do
case "${option}" in
s) SOURCE=${OPTARG};;
t) TARGET=${OPTARG};;
esa
好的,我已经遇到过几次了,这真的很烦人。场景:
modify a file say a.txt (add say two lines)
stash it
stash apply
git reset
remove the two lines added to a.txt because you want to commit and push these partial changes
git add a.txt
git commit the above, and push the changes (push irrelevant for this discussion)
git reset -
我刚刚尝试用另一个分支替换服务器上的master分支,因为master被破坏了,而且我似乎无法解决这个错误……
我用它代替它的分支是我最后的工作版本。为此,我在本地计算机上运行了以下命令:
git结帐lastWorkingBranch
git合并-s我们的主人
git结账母版
git合并lastWorkingBranch主机
git推送原主
然后,在服务器上,我跑
git拉源母机
然而,这提供了以下输出:
Pull is not possible because you have unmerged files.
Please, fix them up in the work t
我正在尝试将我的代码推送到我的远程分支,但一直收到这个错误: ! [rejected] (non-fast-forward)
error: failed to push some refs to 'git@github.com:
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before p
现在,我在本地有一个凭据文件,我在本地使用它来测试我的更改。
set_env.py定义了我用来登录远程应用的环境变量
因为我不想实际推送凭据,所以我推送了一个基本上什么也不做的虚拟文件(例如,环境变量应该已经在测试服务器上定义好了)。
但是,因为我将一个虚拟文件推送到我的分支,所以set_env.py被认为是暂存的,我不能更改分支
git checkout other_branch
error: Your local changes to the following files would be overwritten by checkout:
config/set_env.py
Pl
我有一个需要更新的存储库。
但是,拉取会导致错误:
error: The following untracked working tree files would be overwritten by merge:
实际上我希望它们被覆盖...
如果我尝试推送,也会得到一个错误
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart.
我怎样才能解决这个问题呢?
编辑: git状态:
On branch master
Your branch
我在一个分支(假设是master)上,并且我在我的工作目录中有一些更改。我让东西正常工作,但需要很多清理工作-所以我想把我当前的工作目录保存到一个分支中,以防我需要返回它。我以后肯定会删除这个分支。
此外,我想继续在我所在的地方工作。
现在我知道了:
# Save to topic branch
git checkout -b working-stuff
git commit -a -m "work in progress"
# go back to master and continue with the state is was in before
git checkou
我对错误分支(dev)上的代码做了很少的更改。我想把我所有的更改都转移到master分支,我得到了一些,但我不清楚git stash是否只存储了的文件,甚至是未执行的和未跟踪的文件?
因为,在切换分支之后,我需要在分支上提交和未跟踪的文件。
dev分支机构的状况:
❯ git status
On branch dev
Your branch is up to date with 'origin/dev'.
Changes not staged for commit:
(use "git add <file>..." to update what