Questions tagged [git]

Git is an open-source distributed version control system (DVCS). Use this tag for questions related to Git usage and workflows. DO NOT USE [github] tag for Git-related issues simply because a repository happens to be hosted on GitHub. Also, do not use this tag for general programming questions that happen to involve a Git repository.

Filter by
Sorted by
Tagged with
1
vote
1answer
22 views

On `git checkout [email protected]{0} — .`

If one I run (for example) git checkout [email protected]{0} -- . ...any stashed files that are modified relative to the index show up as staged. Here's a quick example: % git init demo Initialized empty Git ...
1
vote
2answers
22 views

Empty folder when pushing from local to remote

I have a project inside of VS Code which uses git locally and everything is commited / up to date. Now I want to push all that to my server so I can update files on the server while working locally. ...
1
vote
0answers
9 views

Can PHPStorm show edited line status for code that's committed but not yet merged?

PHP shows a "line status" marker in the lefthand gutter indicating whether a line has been edited since "the last update" (per https://www.jetbrains.com/help/phpstorm/file-status-highlights.html#...
1
vote
1answer
13 views

What causes git interactive to not be present when git is installed?

Running on Alpine Linux 3.10, I've installed the distribution's git package using apk. In an existing checkout directory, when I try to launch git add's interactive mode: $ git add -i I get the ...
0
votes
1answer
13 views

Can't resolve merge conflict with git submodule folder

I have two git branches, develop and redesign that I need to merge. I have a submodule called library where its updates are being tracked by develop. When I run 'git merge' it says library has been ...
0
votes
1answer
17 views

Change author in multiple filtered commits

I'm just converting old repositories (SVN & VSS) to Git and in these is a lot of erroneous information I want to correct. I have erroneous authors / committers standing in some time blocks because ...
0
votes
1answer
17 views

Rename the master but preserve branch history

I have a branch I want to rename as master. I have been working on, branching from, and creating pull requests from this branch. My current master is broken as it somehow has a different history than ...
0
votes
0answers
16 views

Git PR Approval Checkmark Color

We have a PR where one approve checkmark is black while the other is green. The green checkmark shows in the "Changes Approved" area at the bottom of the Conversation tab as approved while the black ...
0
votes
0answers
8 views

How to use the GitPython module to do diff between 2 specified commits hashes to get the file paths of changed files?

I am trying to workout how to use the GitPython library to perform the equivalent of the command line but so far have struggled: git diff --name-only headCommit otherGitCommit I have the ...
0
votes
1answer
9 views

Convert regex syntax to glob (switching from Mercurial to Git)

Because Bitbucket are winding down their support for Mercurial, I'm switching over from Mercurial to Git on a number of projects. It seems straightforward enough to do, but I need, I think, to make ...
0
votes
0answers
8 views

How do I set up a private, SSH git submodule for multiple people with BitBucket?

I have a git repo with three smaller git submodules (HTTPS). This repo is private, and shared with roughly 10 people. Whenever people besides me pull this repo, it asks them for my password to ...
0
votes
0answers
8 views

Git CI - How to check that a specific file changed on a new version?

I'm trying to set a simple Git CI. But instead of rebuilding everytime, I want to be able to check if a specific file (let's say requirements.txt) suffered any changes between the last version/commit ...
0
votes
1answer
24 views

How to make sure git shows every conflicts?

I was planning to merge remote branch B into my local branch A. I want to make sure no code is erased during the merge process. That means show all the conflicts to me, I will then decide to keep ours ...
1
vote
0answers
18 views

Why would git log not find path specified as “— .”

I have a rather higgledy-piggledy git repo with several different small directories for different stuff. (Yes, I know that's not best practice, but one gets better at this as time goes by.) If I ...
1
vote
0answers
17 views

grepdiff: Find hunks that DON'T match a given regexp?

Related to Committing trivial changes by regexp with git: Using git diff -U0 and grepdiff --output-matching=hunk, is there any way to obtain only hunks that don't match the given regexp? I am trying ...
0
votes
0answers
24 views

Committing trivial changes by regexp with git

I am trying to clean up a commit history to make it more understandable. Due to a change in style guideline, commits may contain many changes that are nothing more than removing lines containing ...
0
votes
1answer
21 views

Unable to reapply change in feature branch after reverting change in develop

I did the following: Created a feature branch myBranch from the development branch develop In myBranch, created a file myFile.js (Accidentally) created and merged a PR from myBranch to develop In ...
0
votes
0answers
11 views

test:HEAD [rejected-nonfast-forward] error while pushing changes to GIT from anypoint studio

I am getting this message while pushing to github repository. Can you tell me step by step procedure to fix it? I pushed only once and it was successful. But, when I updated a project and tried to ...
4
votes
1answer
44 views

What is the proper way to merge things into the production/release branch?

My team and I are currently working on a small project. In order to do things properly, we are trying to follow a git branching model similar to what's described in https://nvie.com/posts/a-...
1
vote
1answer
27 views

How to delete commits from gitlab? (Git-revert not working)

I am trying to delete the commits circled in red (don't have enough reputation to embed the pic): the answers provided in other threads were click on commit name click "options" click "revert" As ...
0
votes
1answer
21 views

Pre-commit hook not ignoring excluded files

My pre-commit script is not ignoring the files specified in my Rubocop yml file, I assume it is because excludes get ignored if I pass files names directly. However, I am not sure how to resolve this ...
0
votes
1answer
18 views

How to unbundle a git bundle into my already existing but empty repository? [on hold]

I have an empty git repository and I have a bundle, I must unbundle it into my already existing repository. It don't work, I don't understand.
1
vote
1answer
26 views

Use git submodules for reproducible builds (dependency management)?

I'm trying to come up with a way to handle Git project dependencies like the Swift Package Manager. I'd like to specifically capture that, let's say my app version 1.2, depends on framework A, ...
0
votes
2answers
38 views

git push --force will pus wrong branch

I have a main branch "dev", and I checkout a branch "A" base on dev. Do modification on A, commit then push and merged to dev. A has been delete on server. Still made some changes on local A I tried ...
1
vote
1answer
14 views

Jekyll not updating all files

I have the following setup: NAS with GIT Server ---> Raspberry Pi with Jekyll ---> rsync to web-server When the NAS receives a Git commit, it logs into my Pi and activates a script. This ...
0
votes
2answers
22 views

GIT Workflow: Merge most of a feature branch into master, omitting one specific commit?

The context: Two separate features were committed onto the same branch. The oldest commit represents one cohesive feature ("Feature 1"). All the subsequent commits represent a second, separate ...
1
vote
1answer
22 views

Cloning three other branches from a branch

I have an empty branch named result which is empty. I need to clone from the result branch three other empty branches with names - problem_1, problem_2 and problem_3. I need to paste the solutions in ...
0
votes
1answer
17 views

Unable to register git runner on local network server

i'm trying to register a git runner on my company local network server, gitlab is working fine with self singed certificate, but when trying to register a git runner like this sudo gitlab-runner ...
0
votes
0answers
18 views

Files/folder gone from local repository after creating new branch

I cloned a private repo a month ago, and to make sure I didn't lose anything I decided to create a "dev" branch using the github Desktop app. Afterwards, I went to switch branches still using the ...
0
votes
0answers
26 views

Bypass rule for administration group in rules.pl in gerrit configuration

I'm not familiar with prolog language. I've used the example number 8 of the prolog cookbook. https://gerrit-review.googlesource.com/Documentation/prolog-cookbook.html#...
1
vote
2answers
16 views

What's the equivalent command of Eclipse EGit's “Synchronize Workspace”, for git-shell, or GUI like GitKraken?

I have been using Eclipse EGit to manage my git repositories. First I use the "Synchronize Workspace" function and make sure is there any conflicts, then I can decide whether I should pull the newer ...
0
votes
0answers
18 views

Python: TypeError shows up during CI/CD process

I tried to add a TXT file into my python package, load it by pkg_resources, and do some other stuff with data after that. The structure of my python package is following: package_name |-- ...
-3
votes
0answers
24 views

How to update the local with already checked out code from GIT

I have cloned a repo from git 2 days back and now other team members have checkedin their latest code. Please let me know how can I update my project with the latest code changes to my local machine.I ...
2
votes
1answer
19 views

How to change the git log committed log date format

Is there any possible way to change the git log data format from "2019-08-22 06:38:34 +0000" to "20190822063834" in git log command itself or if any alternative options are great git log --pretty=...
2
votes
1answer
16 views

Trying to sign commits on git using gpg on WSL but does not work

I have recently tried the Windows Subsystem for Linux lately and as I was attempting to sign my git commits with a recently generated GPG key it spewed out, [email protected]:~/cpo/...
1
vote
1answer
15 views

Git tag on master branch pointing to merge commit — not available from develop branch

I'm pretty new to gitflow: I've merged my develop branch into my master branch and created a tag, but the tag is pointing to the merge commit so origin/master is one commit ahead of origin/develop. I ...
1
vote
1answer
28 views

Resolving conflicts with branch containing features we don't want to move forward

Apologies in advance if this question doesn't make much sense. We have three branches Dev, Master and Stable. When we create a new feature, we create that from Stable and then create pull requests ...
-1
votes
0answers
25 views

Elixir System.cmd “git”, [“shortlog”] doesn't ever return, why? [duplicate]

I'm trying to get the git shortlog -s summary list from within Elixir. But using System.cmd it never returns. Ugh. Other git commands work just fine: System.cmd "git", ["log"] has no problem. iex(...
1
vote
0answers
21 views

Git backup strategy - nightly clone vs fetch/merge vs pull [on hold]

I have a client with a policy requiring all source code to be "totally backed up" each night. This means that incremental backups are not acceptable. They have a QNAP box with 40TB of RAID. The QNAP ...
0
votes
1answer
26 views

Auto git pull after pushing from local repository

I have openhab2 running on Raspberry Pi and I would like to work on config files remotely with version control. I have git set up on server and made git init in /etc/openhab2. I can see all the files ...
1
vote
1answer
18 views

Syncing 2 repositories with different histories

So I currently have 2 repos: repoA:branchA repoB:branchB Codewise they're identical, but the history on the branches are diff. When I do work I do purely in repoB:branchB (so open a PR, get ...
3
votes
2answers
37 views

How to use git filter-branch on pattern of folders

I've committed a bunch of sensitive data to my local repo that has not been published yet. The sensitive data is scattered across the project in different folders and I want to remove all these ...
0
votes
0answers
27 views

Git committing all changed, not just stagged changes after git add -p

I am trying to get a partial change committed in git, and it seems to be doing what I would expect up until the actual commit, where unstaged changes get added to the commit. Basically, I am staging ...
1
vote
0answers
12 views

git-rebase cause directory link number decrease to 0

I have Tree questions: Why git-rebase throw fast-forward failed (the commits are in all local) How to create a directory with link number 0 How to delete the directory(link number 0) without removing ...
1
vote
1answer
19 views

Don't push changes in files

There is a file which I want to push but without changes I'll do. For example: // config.js "default text" And I have to modify the config.js: // config.js "my modified text" But when I push this ...
0
votes
3answers
28 views

How can I compare the most recent commit with the previous commit?

How can I compare my most recent commit with the previous commit? I'd like to know the diff between 83a853349d91c855442c and 35ad2211a1cc7d0dbd49 (without having to specify the actual commit sha) $ ...
0
votes
0answers
11 views

How to get yarn.lock to point to most recent commit

I have a dependency in my package.json that points to a git repo and branch (eg git+ssh://[email protected]/some-repo#some-branch-name). When I install dependencies, yarn resolves the commit-ish to a ...
0
votes
0answers
9 views

Delete all git docker images in the gitlab registry except images tagged as latest

I am rewriting my gitlab CI/CD pipeline and I would be including a stage, which would tag the latest image as latest, so I would like to delete every other image in the registry. I was looking at the ...
1
vote
0answers
25 views

Electron app.on('ready'… never being called and electron window never showing. Seemingly tied to specific Git repository

Summary I'm new to Electron development, and helping to lead a small project at work creating an electron application. After working inside the Git repository for a day or so, the electron window ...
0
votes
1answer
26 views

Azure DevOps - Use YAML templates in a Git Submodule

So i have 11 repositories of 1 project, they are all micro-services. I have one repository called DevOps where everything that has to be shared across YAML builds, is shared using a Git Submodule. ...