1,117 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
2
votes
3
answers
207
views
Why is git HEAD pointing to two branches?
The git installed on my machine always creates master when I initialize any folder as git:
PS C: \job-artifacts-and-outputs› git branch --show-current
master
So my local branch name is always master ...
0
votes
0
answers
68
views
Git checkout -p (patch) from one branch to another for a binary file?
Situation
I have a branch master/mywork and v4.9/mywork. These branches (and their parents, master and v4.9, to be precise) differ in many places but are also similar in many other places.
I created a ...
-3
votes
2
answers
124
views
should git checkout work when the index is dirty?
I created a branch to do some work on, tried to merge another branch into it, and immediately ran into an insurmountable merge conflict. Clearly the thing to do was abandon the branch and start over.
...
0
votes
0
answers
50
views
git file always shows modified vs local index
On Windows working with C# files
I think what may be happening here is that in the local index the file has LF line-endings.
So even when git restore myfile or git checkout myfile git immediately ...
2
votes
1
answer
71
views
Does updating the submodules before checking out a tag have any adverse effects?
I am trying to clone a git repo and checkout a particular tag. But I have a doubt regarding the order of commands. For now, I follow these steps:
git clone <some_repo>
cd <repo_dir>
git ...
0
votes
1
answer
235
views
Your branch is ahead of 'origin/main' by X commits even after git push
I recently started using GitHub to manage my code, using git commit -a -m command to commit changes to all files (-a) added with git add <filename>, along with a message (-m).
After that, I run ...
0
votes
1
answer
117
views
Can I checkout an unfetched remote git branch, with a single command?
A very popular question here on SO is:
How do I check out a remote Git branch?
but the answers there either assume the branch-of-interest is already fetched, or suggest that we git fetch first.
My ...
2
votes
2
answers
223
views
Preserve ignored untracked files across checkout
I picked up an external project, which I will be developing from now on.
As a failsafe measure, I made 2 branches:
One without a .gitignore, so as to not lose untracked files, called gitignoreless.
...
-2
votes
1
answer
64
views
Is there a shorthand to go forward through children in git? (opposite of ~) [duplicate]
I have a completely linear git history (to make things simple), such that
git log --oneline --graph --all
shows
* eff3139 (branch_2) foo
* f217e05 bar
* 8d1c27b baz
* c10bb66 (HEAD -> master, ...
-1
votes
1
answer
54
views
Is there a command equivalent to `git checkout --theirs` and `git checkout --ours` with `git reset`?
I prefer to use other commands than git checkout because of the ambiguity of git checkout; I prefer to use git reset (and git switch for branches).
However, I have noticed that I don't know how to do ...
0
votes
1
answer
674
views
gitlab runner skipping checkout even with GIT_CHECKOUT set to true
I have gitlab-runner 17.1.0. My .gitlab-ci.yml file has GIT_CHECKOUT: true, but gitlab still skips checkout. Any idea why?
This excerpt from log shows the problem:
Running with gitlab-runner 17.1.0 (...
0
votes
1
answer
103
views
Git actions/checkout "ambiguous argument 'HEAD^'"
This is my first time using git actions. I want to create different filetypes of the same text using pandoc. Since I'm using free runtime for this (and there may be more actions to come) I want to ...
1
vote
1
answer
340
views
GitKraken issue when checkout with submodule
I have a problem when I checkout from one branch to another in a repo containing git submodules.
For example:
parent-repo (branch master)
.
├── test.txt
└── README.md
parent-repo (branch develop)
.
├─...
-1
votes
1
answer
66
views
Quickly flip through Git commit history [duplicate]
I want to learn a new project, I need to constantly switch in the project's commit history so that I can view the code. First, I execute git switch --detach commit-hash to bring the project back to ...
-2
votes
2
answers
72
views
Is there a way to checkout latest version of origin branch without warnings [closed]
I wrote a powershell script to obtain git submodule and set his branch. It will run from pipeline and branch name will be passed from launch form input.
Param(
[Parameter(Mandatory=$false)]
[...