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 [tag: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.

0
votes
0answers
8 views

Is there a way to checkout git repository, to certain folder with maven?

I am attempting to automatize download of repository containing only protocol-buffers (with structure), to "resource" folder for later processing. I need this kind of functionality, to keep my *....
0
votes
2answers
15 views

Copy version of file from other branch or commit without overwriting current version?

As part of a test script, I want to copy the version of a file from the head of origin/master without overwriting the current version of that file in the branch I have currently checked out. To ...
1
vote
1answer
16 views

How can I move branch files from an old repository to a new one without the old commits

I am creating a new pristine repository for the next generation of our product. I need to use some "state" from the old repo -- similar to cherry-picking. In fact, functionally it would be simply ...
1
vote
1answer
16 views

Is there a way to configure 'git commit -a' to NOT include submodule changes

The most common way to accidentally pick up submodule changes is to do a pull, forget to submodule update, and then do a git commit -a (which will add the submodule changes). Is there a way to ...
0
votes
1answer
12 views

Plumbing equivalent of 'git diff REVISION'

git diff respects color.ui=always, among other things. Is there an equivalent plumbing command that will always give me a valid unified diff that I can apply using patch?
1
vote
1answer
16 views

I'm looking for real-life example of React testing with Jest & Enzyme

I know my question is very abstract, but I'm struggling to understand what exactly should/shouldn't be tested in React app. What I'm looking for: Something like Git repository of popular project with ...
0
votes
0answers
6 views

Issues with running sh file for performing git pull on Windows Task Scheduler

I am trying to write a script that executes a git pull and schedule it to run every 5 minutes via Windows Task Scheduler to run on Git Bash. It runs successfully when I execute it manually but does ...
1
vote
1answer
12 views

Remove unstaged, uncommitted files in git when checking out a different branch

I deleted both the local and remote branches for a particular branch git branch -d branchName git branch --delete --remotes origin/branchName When I checkout out a different branch, I am still ...
-1
votes
0answers
9 views

How can I checkout code from TFS (git or TFVC) with Jenkins, like how I'd do it for gitlab/github?

I'm simply just trying to checkout code from TFS, but I can't find any good solutions? I have the TFS plugin, and I can obtain my Jenkinsfile, but how can I checkout code from my project? It's very ...
2
votes
1answer
36 views

Is it possible to “unmerge” a merge commit by simply removing one of the parent pointers?

I would like to "unmerge" branch "A" from branch "B". In the above image, that would mean simply removing the dotted line between commit "095195e" and "A". I do not want to use revert, because I ...
0
votes
1answer
21 views

How to save new Django database entries to JSON?

The git repo for my Django app includes several .tsv files which contain the initial entries to populate my app's database. During app setup, these items are imported into the app's SQLite database. ...
-1
votes
2answers
44 views

How can I export just the file names of commits to a txt file in git? [duplicate]

I'm trying to export the file names of the files that were changed through commits in git to a txt file. How can I approach this problem? I just want the file name and I would like one file name on ...
1
vote
1answer
26 views

Is there a way to non-interactively rebase and squash everything in my feature branch?

Sometimes I have a bunch of small commits in a feature branch, and I'd like to just squash them all together, but not merge into the parent branch yet. I know I can (in this example parent branch is ...
0
votes
1answer
15 views

Identifying a user from their commit using a Personal Access Token in GitLab

How can I identify who pushed to a GitLab repository when a commit was made with a Personal Access Token? I'm interested in auditing the commits done to a shared repo. When using a token to push to a ...
0
votes
2answers
31 views

How to monitor a git branch using python?

i would like to know if anyone know any library for git that would help me to monitor a git branch for any new commits. Idea is to check for new commits & read the files impacted, if the impacts ...
0
votes
1answer
22 views

Revert git commad (filter-branch)? [duplicate]

I had a finished a project but could not upload it to git because of a huge file with more than 100MB because git doesn't allow it. So I deleted the file, and I was still getting the same error. I ...
-3
votes
1answer
15 views

How to prevent file modification in git reposiory

How can I prevend to be touched a particular file also if I checkout a branch where there is this file. I tried with gitignore but it there is in the branch it will be overwrite.
0
votes
1answer
23 views

Difference between git checkout - and git checkout master

What are the differences between: git checkout - and git checkout master Thanks
3
votes
1answer
23 views

Pushing pre-commit git hook (Rubocop)

I've currently configured my repository to use Rubocop for pre-commit linting by creating a pre-commit hook under ./git/hooks However, I'd like this to be available to everyone working on my team, ...
1
vote
0answers
23 views

Skip GitHub dependencies with npm install

For a brief introduction, I have automated builds that install dependencies from NPM to run some analysis on them. So it is important to consider that, after running npm install, the application doesn'...
1
vote
1answer
13 views

Move file change from one commit to the working copy

Let's say I just made commit1 that had two changes: modified fileA.txt modified fileB.txt Then I realized I made a mistake - I wasn't ready to commit my fileB.txt changes! I want the fileB.txt ...
0
votes
1answer
24 views

Delete some oldest commits that includes data files

I have a remote git repository. The remote includes a bunch of commits. I have pushed my dataset (data files almost 3 GB) to remote by mistake. I want to remove/delete some oldest commits that ...
0
votes
0answers
8 views

View ALL Git diffs at once inside VS Code (or other difftools)

I have configured my Git difftool to be VS Code: [diff] tool = default-difftool [difftool "default-difftool"] cmd = code --wait --new-window --diff $LOCAL $REMOTE prompt = false This ...
0
votes
0answers
9 views

Splitting git repositories removing all non-related commits to a given folder [duplicate]

There is only one project (repository) that is being split in two. One of its folders will become a separated project (repository), so we need to remove all commits that aren't related to this given ...
3
votes
2answers
36 views

Do duplicate files increase git repo size? [duplicate]

If I, in various directories, have several files, with different filenames, but with the exact same content... Will each duplicate increase the repo size, or will they be stored as "one" file? For ...
0
votes
0answers
17 views

How can I override config for the commitizen vs code extension?

How can I overide the configuration (types, scopes, message etc.) of commitizen extension for vs code https://github.com/KnisterPeter/vscode-commitizen ? They write "To configure this extension ...
0
votes
1answer
25 views

Editing files as a collaborator on GitHub

I am trying to make changes to a GitHub repository for which I have been invited as a collaborator. I can create new files and modify them, but when I tried to do any changes to an existent file I saw ...
0
votes
1answer
13 views

Git rebase causing “unlink of file failed” errors

Oftenly when I do a git pull --rebase I get this kind of output: > git pull --rebase Auto packing the repository in background for optimum performance. See "git help gc" for manual housekeeping. ...
0
votes
0answers
5 views

Importing repository in Azure DevOps with Git LFS

I am trying to migrate Bitbucket repositories to DevOps using the import repository function in DevOps. Some of those repositories have LFS enabled, and it looks like DevOps does not import the LFS ...
0
votes
2answers
20 views

Multiple git credentials for same context

Is there a way to use multiple credentials for the same context? Something like this: [credential "https://example.com"] username = me username = me2 username = me3 What can I do if for ...
0
votes
1answer
30 views

Git: Is it possible to rename master? [duplicate]

Is it possible to rename the master in git? If that's not possible, is there a way to obtain a similar result? e.g. create a branch with a custom name (say batman), make that branch the new master and ...
-1
votes
1answer
77 views

fatal: Not a git repository: '.'

I have a valid git repository named /tmp/A. When I cd to the /tmp/A and run any git command from bash it works good, but when I run git commands from callCommand call in haskell programm I get error: ...
-1
votes
0answers
26 views

remote: GitLab: API is not accessible [duplicate]

Hi when I try to push gitlab for the first time it showing error after the writing is done. remote: GitLab: API is not accessible or ! [remote rejected] master -> master (pre-receive hook declined) ...
0
votes
0answers
15 views

How to automate dependency management using setuptools and pip when I have dependencies on git repos?

I want to find a way to make my package development and use as automatic as possible. Some of my package's dependencies are self-developed packages which are to be found in a git repository. When I ...
-3
votes
1answer
25 views

What does checkout mean?

One of my professors told me to write a shell script that checkout code. His exact words are these : Write a shell script that will checkout the 'XYZ' code, compile it and run the unit tests. This ...
2
votes
1answer
32 views

Git log, display specific data (by regex) with specific color

I use this command to display git log: git log --oneline --decorate --graph --all --pretty=format:'\''%C(yellow)%h %Cred%ad %Cblue%an%C(auto)%d %Creset%s'\'' --date=format:'%d.%m.%Y'' As you can see,...
0
votes
0answers
10 views

Managing repositories in synch after splitting master repository

Hello Stack Community, Recently we spitted our main/joined repository (containing frontend and backend implementatons): .git +--backend +--frontend Into two separate repositories: .git +--...
-1
votes
0answers
28 views

Git commit and push on new branch

I started with a project and I was in master branch. I created a new branch using git checkout -b mynewbranch Then I pushed mynewbranch to master using git push origin mynewbranch Then I checked ...
1
vote
1answer
21 views

Is there any way to checkout another branch readily in git?

I'm working on a web project right now. There are several branches; develop branch for debugging, feature branches for new features, etc. The QA tester needs to test on both branches at the same time, ...
0
votes
0answers
20 views

Branch checkout changing the timestamp of non-modified files

I have a bitbucket branch. when we tried to checkout the branch to sub-directory on jenkins server using jenkins job. it checked out whole repository everytime. it changes the timestamp of all the ...
0
votes
0answers
24 views

Azure DevOps language of git repository?

I saw on github.com we can see the language used for each repository. Something similar exist for the projects section of Azure DevOps but I could not find anything more.
1
vote
0answers
18 views

How can I share or link to a GitHub enterprise (university) account repository?

My university has a custom GitHub enterprise domain, and I have been working on a number of personal/group projects there. However, going for graduate job interviews, it would be handy to share access ...
1
vote
1answer
32 views

Old HTML/CSS files did not update with git push on GitHub

I'm pretty new with GitHub and GitBash, I uploaded (by dragging the files) a folder that included my HTML and CSS files 11 days ago. Today I finally figured out how to push them with the terminal, ...
1
vote
2answers
34 views

how to uncommit all files from remote repository

I have a branch that I need delete all files from remote repository and turn it untracked files, how can I do this? I tried to use git rm but it just deleted
1
vote
1answer
33 views

“already exists and is not an empty directory” for Empty Directory using Docker

I've been working on a Docker image that pulls necessary files from a github repo and then builds itself. It is intended to just update itself from github each time, but to test it I have been ...
0
votes
1answer
21 views

Often(but not always) after using the git log command, : are shown on my terminal window and it just becomes unresponsive

I tried searching on the web and here on Stackoverflow but can't seem to find a similar problem/ solution. I'm not exactly sure on how to word this problem, so i've added an image link. I get this ...
0
votes
1answer
29 views

How to get all commit releated to a folder and put it into new repo?

I have a git repo like repo /sub-project1 /sub-folders and files /sub-project2 /sub-folders and files /sub-project3 /sub-folders and files i want to remove /sub-project1 /sub-folders and ...
0
votes
0answers
20 views

Which command should we use to find out which files are unique to that specific branch in git and are not carried from previous branch? [duplicate]

Basically, I am looking for an command which would show me which file is unique for the specific branch that I am looking into. Sometimes, files get carried on while creating new branches.So, I want ...
3
votes
1answer
25 views

How do I change which commit the git gutter in IntelliJ is comparing against

The git gutter in IntelliJ is a good way to see your changes to a file. It compares the current version of the file against the last commit. However, when I commit my changes, the indicators in the ...
1
vote
3answers
46 views

How do I commit my saved files on GitHub to a different branch?

Currently, the branch that I can commit saved files to is master. However, I want to commit my saved files to a different branch called "First-Level" (I'm designing a game). But I haven't managed to ...

http://mssss.yulina-kosm.ru