Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Posts tagged version-control

2 child tags

Use for questions dealing with the management of changes to documents, programs or other stored information. For specific version-control systems, directly tag with specific tag (e.g. [git], [tfs]).

This tag doesn't have a detailed wiki yet.

71%
+3 −0
Q&A Why force designation of a remote main branch?

GitHub seems to require that one of the branches on it be marked as the "primary" branch. I understand this (perhaps mistakenly) to be the origin/HEAD. Why would they make it compulsory? On forked...

2 answers  ·  posted 15d ago by Michael‭  ·  last activity 14d ago by InfiniteDissent‭

Question git github
75%
+4 −0
Q&A Get the name of the remote tracked branch of my local branch for use in script

Can I programmatically get the name of the remote branch which my local branch is tracking? I'm interested in scripting around git-range-diff(1), so that I could do something like this: [alias] ...

1 answer  ·  posted 24d ago by alx‭  ·  last activity 16d ago by Alexei‭

Question git
70%
+5 −1
Q&A How to disable jobs in GitLab CI after they are successfully executed

I'm working with GitLab CI. The pipelines I'm designing contain several jobs that, once executed successfully, there shouldn't be any reason to retry/rerun them. This is an example: default: # ...

1 answer  ·  posted 1mo ago by ɯıpɐʌ‭  ·  last activity 1mo ago by Alexei‭

Question gitlab-ci
71%
+3 −0
Q&A Get global gitconfig path

Is there a command I can run to get the path of global gitconfig for a user? Like git config --global --edit, but I want the path, not an editor window. I want the right path whether or not this f...

2 answers  ·  posted 1mo ago by Michael‭  ·  last activity 1mo ago by InfiniteDissent‭

Question git
83%
+8 −0
Q&A After git fetch, how to fast forward my branch?

I did git fetch to quickly get latest commits. I did this instead of git pull so I could deal with merge conflicts offline. But my repository is still stuck on the old commit, and now git pull fail...

2 answers  ·  posted 8mo ago by matthewsnyder‭  ·  last activity 2mo ago by hkotsubo‭

Question git
77%
+5 −0
Q&A How to keep git blame ignored commits up to date?

When I make a separate commit for code cleanup / style changes, I can suppress that commit from git blame so that I can follow a file's history easily without getting distracted by pure style chang...

1 answer  ·  posted 4mo ago by HeavyRain‭  ·  last activity 3mo ago by Alexei‭

Question git
66%
+2 −0
Q&A Filter stashes by pathspec

The documentation for git stash list says list [<log-options>] List the stash entries that you currently have. Each stash entry is listed with its name (e.g. stash@{0} is the latest entry...

0 answers  ·  posted 12mo ago by Michael‭  ·  edited 6mo ago by Michael‭

Question git git-stash git-log
66%
+2 −0
Q&A Turn all changes after latest origin/main into a branch

I have a git history that basically looks like this: * commit: XXX (HEAD -> main) | | * commit: YYY | | * commit: ZZZ (origin/main) | | ... Now I would like to turn everything after...

2 answers  ·  posted 7mo ago by celtschk‭  ·  last activity 7mo ago by matthewsnyder‭

Question git
77%
+5 −0
Q&A How can I git checkout the previous HEAD?

After switching to a different branch, git checkout - can move me back to the branch I came from. This is handy for times when I wonder "wait, what was that last branch again?" But this does not w...

1 answer  ·  posted 7mo ago by matthewsnyder‭  ·  last activity 7mo ago by hkotsubo‭

Question git
63%
+5 −2
Q&A Is `git pull` dangerous?

I heard git pull is dangerous. Is it really dangerous? If so, why or how is it dangerous? Are there any flags that mitigate or remove the danger? What are the alternatives if it...

2 answers  ·  posted 7mo ago by alx‭  ·  last activity 7mo ago by alx‭

Question git
84%
+9 −0
Q&A What is the general process for merging two git branches, reviewing edits on each branch?

Suppose you have a largish git repository with many files of different types (both text and images) distributed among a number of nested directories. Parallel development has occurred on two branc...

2 answers  ·  posted 9mo ago by SystemExplorer‭  ·  last activity 8mo ago by Michael‭

Question git
81%
+7 −0
Q&A Git apply vs git am

What are the differences between git apply and git am commands? Both seem to be used for applying patches to repositories. When should one be used over the other?

1 answer  ·  posted 1y ago by Iizuki‭  ·  last activity 8mo ago by Michael‭

Question git
66%
+2 −0
Q&A Docker push fails with message "denied: requested access to the resource is denied"

Recently I had to push a new Docker image to our GitLab registry. I have the Maintainer role on that project. I had created a new token and used it to log in to Docker. However, when trying ...

2 answers  ·  posted 11mo ago by FractionalRadix‭  ·  last activity 10mo ago by Alexei‭

Question docker gitlab
81%
+7 −0
Q&A PGP sign emails sent with git-send-email(1)

How can we use git-send-email(1) to sign patches (emails) with the gpg(1) keyring? I've heard it can be done, but couldn't find anything in the git-send-email(1) documentation nor in a web search.

3 answers  ·  posted 3y ago by alx‭  ·  last activity 11mo ago by alx‭

Question git email pgp signing
66%
+2 −0
Q&A Adding dependency with cabal in gitlab-ci

I have a project I normally build with nix and cabal, however I also want to publish my documentation onto gitlab pages. It's impractical to run my nix on the gitlab CI, so I've just been using cab...

0 answers  ·  posted 12mo ago by WheatWizard‭

71%
+3 −0
Q&A What is a .gitkeep file?

Sometimes there are empty files named .gitkeep sprinkled around a repository. What are these files?

1 answer  ·  posted 12mo ago by Iizuki‭  ·  edited 12mo ago by Iizuki‭

Question git
77%
+5 −0
Q&A How to delete a remote branch in git?

How to delete a branch from a remote in git? E.g. maybe you had this branch locally too, but you deleted it already according to this question. Now you want to get rid of the corresponding remote ...

2 answers  ·  posted 1y ago by Iizuki‭  ·  last activity 1y ago by hkotsubo‭

Question git
66%
+2 −0
Q&A Git command formatting characters in msbuild are interpreted incorrectly

I wish to add a property with the date of the current Git commit to the assembly info. From my .csproj: <Exec Command="git -C &quot;$(ProjectDir).&quot; log -1 --pretty=format:%ad" ...

1 answer  ·  posted 1y ago by LyndonGingerich‭  ·  edited 1y ago by Michael‭

81%
+7 −0
Q&A What is the point of triggering CI/CD with an empty git commit?

I read posts (e.g., 1, 2, 3) that recommend triggering a CI build process by pushing an empty git commit. I don't understand how this is a good idea as the commit history will be peppered with mea...

3 answers  ·  posted 1y ago by toraritte‭  ·  last activity 1y ago by matthewsnyder‭

Question git ci/cd
77%
+5 −0
Q&A Can GitHub rewrite authorship of commits?

GitHub has a setting wherein they offer to "anonymize" your user email from, say, somebody@example.com to somebody@users.noreply.github.com. I presume this is to prevent you from getting spam from ...

1 answer  ·  posted 1y ago by Michael‭  ·  edited 1y ago by matthewsnyder‭

83%
+8 −0
Q&A Git-ignoring files with special characters in their names, especially newlines

My actual motivation is to understand the semantics of the .gitignore file syntax in precise detail, for a program which is expected to emulate them as accurately as possible. However, while coming...

1 answer  ·  posted 1y ago by Karl Knechtel‭  ·  last activity 1y ago by Peter Taylor‭

Question git linux gitignore
77%
+5 −0
Q&A How to run Gitlab CI jobs only in specific branches?

By default Gitlab CI jobs run on any commit. I would like to restrict some of them to run only on commits to specific branches. How to do this in .gitlab-ci.yml?

1 answer  ·  posted 1y ago by Iizuki‭  ·  last activity 1y ago by Iizuki‭

Question gitlab-ci
81%
+7 −0
Q&A How to revert main branch to an earlier commit in git?

How to move the main branch back to an earlier commit in git?

2 answers  ·  posted 1y ago by Iizuki‭  ·  last activity 1y ago by Michael‭

Question git
77%
+5 −0
Q&A What are the benefits of starting a Git repo with an empty commit?

Found an article about starting a repo with an empty commit. Read the post a couple of times, but still don't understand the reasoning: 1. git log and other commands blow up with terrifying ...

2 answers  ·  posted 1y ago by toraritte‭  ·  last activity 1y ago by Michael‭

Question git
80%
+6 −0
Q&A How to compare a git stash to the current working tree?

In git you can put your current changes aside for a moment with git stash. This is really neat but what often ends up happening is that you forget what was in there, and what was the state of the b...

1 answer  ·  posted 1y ago by Iizuki‭  ·  edited 1y ago by Iizuki‭

81%
+7 −0
Q&A Git add/stage only part of a file's changes

Say I've made a bunch of changes to a file and would like to split those changes into two or more commits. Normal git add however stages the whole file in one go. So how to add only some of the ch...

1 answer  ·  posted 1y ago by Iizuki‭  ·  last activity 1y ago by Iizuki‭

Question git
60%
+1 −0
Q&A How to delete a local branch in git?

How to delete a local git branch which hasn't been pushed to anywhere, and only exists locally?

1 answer  ·  posted 1y ago by Iizuki‭  ·  edited 1y ago by Iizuki‭

Question git git-branch
71%
+3 −0
Q&A How should open source forks, with a mix of upstreamable and non-upstreamable commits, be maintained?

I have a few different projects that rely on open source technology that I wish to make modifications to (say, to add key features for business or personal use) that will vary between upstreamable ...

1 answer  ·  posted 1y ago by eoin.oneill‭  ·  last activity 1y ago by matthewsnyder‭

Question git repository
81%
+7 −0
Q&A How do I customize merge behavior for a shared git repo?

I often find it useful to arrange things so that each commit on master's first-parent is a discrete change. It allows git log --first-parent --oneline to be used as a concise, automatically-generat...

1 answer  ·  posted 4y ago by ajv‭  ·  last activity 1y ago by GrantMoyer‭

Question git git-merge
60%
+1 −0
Q&A `git submodule foreach git pull` in parallel

I use git submodule foreach git pull to update my submodules. There's quite a few and it appears that foreach is updating them one by one, instead of in parallel. How can I do it in parallel?

1 answer  ·  posted 1y ago by matthewsnyder‭  ·  last activity 1y ago by GrantMoyer‭

Question git git-submodule
66%
+2 −0
Q&A Reaching to a directory in git-bash

I have created a directory named Temporary_add_to_version_control on Desktop. Now I am trying to reach that directory by typing the following in git-bash: cd ~/Desktop/Temporary_add_to_version_con...

1 answer  ·  posted 1y ago by Birbal01‭  ·  edited 1y ago by meta user‭

Question git-bash RStudio
77%
+5 −0
Q&A How to move a tag in git?

I have created a tag in my project, using git tag v2023 However, I forgot to commit a few changes. Now I would like to move this tag to the current point (after having committed the changes I had...

1 answer  ·  posted 1y ago by mr Tsjolder‭  ·  edited 1y ago by meta user‭

Question git version-control
86%
+11 −0
Q&A Git: How to clone only a few recent commits?

How do I clone the repository with only part of the history? For example, let's say I want to download only the last 5 commits out of thousands.

2 answers  ·  posted 1y ago by matthewsnyder‭  ·  last activity 1y ago by hkotsubo‭

Question git-clone
66%
+2 −0
Q&A Clone .git repo into current dir, without touching files

I have git repo where the .git is deleted. I didn't realize it until after I made some changes to the code. I want to re-create the .git by cloning. However I don't want it to touch the files that...

1 answer  ·  posted 1y ago by matthewsnyder‭  ·  last activity 1y ago by matthewsnyder‭

Question git-clone
66%
+2 −0
Q&A Resolving "fatal: Unable to find remote helper for 'https'" and a warning about templates

On a live boot of Ubuntu 20.04, I was trying to clone into a private GitHub repository. I went through the hassle of installing git, and then gh, and making sure I was signed in through the termina...

0 answers  ·  posted 1y ago by Mithical‭

Question git
80%
+6 −0
Q&A Why is git merge from rather than to?

Why does git merge take the source branch rather than the destination branch as a parameter? The most common merge case by far for me is "Okay, this branch looks good, let's merge it into branch X...

4 answers  ·  posted 1y ago by matthewsnyder‭  ·  last activity 1y ago by hkotsubo‭

75%
+4 −0
Q&A How do I pull new changes in git submodules?

I have a git repository with some submodules. When the submodule repos get new commits on the remote, how can I pull them all?

0 answers  ·  posted 1y ago by matthewsnyder‭

Question git git-submodule
77%
+5 −0
Q&A Possible drawbacks for having duplicate local sources of the project tracking the same Git remote

Context I have started working on an Angular upgrade for a medium-sized project (from v. 10 to v. 15) and this is a rather long activity that is interrupted by other changes that need to be perfor...

2 answers  ·  posted 1y ago by Alexei‭  ·  last activity 1y ago by Andrew‭

Question git angular upgrade npm
75%
+4 −0
Q&A How to make Husky run git hook?

How to make Husky run git hook? I have a working git hook, prepare-commit-message, but the moment Husky was installed, the hook stopped working. Not finding much luck, I then tried to make it a "H...

1 answer  ·  posted 2y ago by LAFK‭  ·  edited 2y ago by Alexei‭

Question git husky git-hook
92%
+24 −0
Q&A What is HEAD in Git?

In Git documentation, there are lots of references to the term "HEAD". But what exactly is it? Some places refer to it as "a pointer to the current branch". So it's a branch? What is it used for?

1 answer  ·  posted 3y ago by hkotsubo‭  ·  last activity 2y ago by hkotsubo‭

Question git terminology
77%
+5 −0
Q&A Keep local branch changes to resolve all remaining conflicts in a merge

On branch-x, I do git merge branch-y Now there are some conflicts, and git status shows Changes to be committed: new file: a new file: b Unmerged paths: (use "git a...

1 answer  ·  posted 2y ago by Quasímodo‭  ·  last activity 2y ago by Quasímodo‭

75%
+4 −0
Q&A How to configure .gitignore to ignore all files except a certain directory

MWE In the terminal run: mkdir mwe cd mwe mkdir dir touch f1.txt f2.pdf dir/f1.txt dir/f2.pdf git init . Create a .gitignore with: * # ignore all !dir/ # except this directory ...

1 answer  ·  posted 2y ago by mcp‭  ·  last activity 2y ago by Moshi‭

Question git gitignore
85%
+10 −0
Q&A Is it possible to undo a git reset?

For some reason, I just wanted to undo a commit on my git repository, which I've done with the following command: git reset --soft HEAD~1 So far, so good. However, by mistake I issued the comma...

2 answers  ·  posted 3y ago by celtschk‭  ·  edited 3y ago by Alexei‭

Question git git-reset
81%
+7 −0
Q&A Console scripts in virtual environment do not output to terminal in git bash

I have console scripts in my virtual environment in \env\Scripts, installed with packages (e.g. black, pytest, coverage). If I try to execute these in Git Bash, the output is not returned to the te...

1 answer  ·  posted 3y ago by boudewijn21‭  ·  last activity 3y ago by boudewijn21‭

22%
+0 −5
Q&A Ignore code paths

I try to ignore paths in the Codeql code scanning file. But every scan it seems that scanning doesn't ignore these files, do you have any tips?

0 answers  ·  posted 3y ago by fadi‭  ·  edited 3y ago by Alexei‭

Question path codeql ignore
84%
+14 −1
Q&A What's the correct way to merge a branch and its dependent branch back to master?

In git I branched feature-A from master. To reduce eventual merge conflicts later, I branched feature-B, which heavily overlaps and depends on A, from feature-A. A build of the feature-B branch s...

2 answers  ·  posted 3y ago by Monica Cellio‭  ·  edited 3y ago by hkotsubo‭

81%
+7 −0
Q&A Conditionally ignore files in git

I'm using git for LaTeX projects and am in a little dilemma about how to best ignore files. if I add *.pdf to my .gitignore file, I keep forgetting to force add included graphics if I don...

3 answers  ·  posted 3y ago by samcarter‭  ·  last activity 3y ago by Peter Taylor‭

Question git gitignore
25%
+0 −4
Q&A Git deployment vs SFTP deployment [closed]

I personally use git for deploying my hobby projects into cloud like Heroku. I came across the concept of sftp for uploading files. Now please differentiate these two deployments like when to use w...

0 answers  ·  posted 3y ago by aditya98‭  ·  closed 3y ago by Alexei‭

Question git sftp
81%
+7 −0
Q&A Is it a good idea to have a permanent branch for a feature?

I'm rather new to using git, so I'm not sure about the best practices regarding it. I have a feature branch branched off, and periodically when the feature needs to be updated I will add some commi...

3 answers  ·  posted 3y ago by Moshi‭  ·  last activity 3y ago by Hyperlynx‭

81%
+7 −0
Q&A How do I ask git-show-branch to display a commit range?

For some tasks, I find git show-branch easier to follow than git log. For example, inspecting the history on someone's PR before merging it. git show-branch master topic stops at the first common ...

1 answer  ·  posted 3y ago by ajv‭  ·  edited 3y ago by Alexei‭