我是新手git,我在练习.我创建了一个本地分支,但是当我完成时,我看到git push我的分支没有上传到存储库.我必须这样做:git push -u origin --all.
为什么是这样?不是分支是默认推送的新变化吗?为什么我需要运行第二个命令?
当我做一个git pull,从git bash,终端通常运行拉,更新我的本地,然后挂起.我不确定它是否在等我做某事,但我通常会退出CTRL-C.之后,我得到一个index.lock阻止我做其他我必须删除的东西.我误解了怎么git pull运作?
当我尝试将我的代码上传到 github 时。以下是我在 GitBash 终端中执行的步骤。在尝试使用 $git push -u origin main 将代码推送到 github 时,光标移动到下一行并不断闪烁但什么也不做。
git remote add origin "https://github.com/TarunRajinikanth/Trifacta.git"
git add -A
git config --global -user.name "username"
git config --global -user.email "useremail@gmail.com"
git commit -m "this is my first commit"
git branch -m main
git push -u origin main
Run Code Online (Sandbox Code Playgroud)
