Questions tagged [git]

59670 questions
1

votes
1

answer
107

Views

git fetch to different local remote refspec

I have only master branch on my remote origin. Then I did: git fetch origin refs/heads/master:refs/remotes/origin/master2 as a result I got: * [new branch] master -> origin/master2 which seems all right. It is shown as remote tracking branch with the master: bash$ git branch -r origin/HEAD...
user1337
1

votes
1

answer
242

Views

All the commit history from SVN is not migrated to GIT

I am a developer and for the first time , I am migrating my whole SVN repository to a GIT repository. As a POC, I have migrated current development branch. Migration was successful with the history as well. Problem : SVN commit history in GIT Result of migration : All the history of current dev bran...
Venkata
1

votes
1

answer
19

Views

Git: Update my remote git to be the same as my local

I'm relatively new on git, so keep that in mind. So, I have three branches: master b1 b2 This is how my local and remote repository look like. At one point, I merged b2 in to the master, and deleted b2 (all of this on my local repository). Lastly, I pushed my master to my origin/master. My questio...
Dimitris Pantelis
1

votes
1

answer
68

Views

Pushing branch without root to the new repository

Imagine I have master branch. Once new branch was created. Now I want to move exactly this branch to the new repository without comments that was commited before this branch was created. Picture: 1. Old repository newbranch C - D - E / master A - B Picture: 2. New repository newbranch C - D -...
vladimir
1

votes
0

answer
62

Views

How to fetch code additions and deletions from Bitbucket API 2

In the GitHub API we have the possibility to get stats from a specific commit. E.g.: 'stats': { 'additions': 104, 'deletions': 4, 'total': 108 } I would like to know if for Bitbucket API V2 we have the same feature, I'm currently using: curl -X GET -H 'Authorization: Bearer ZZZ' -H 'Content-Type: ap...
g__n
1

votes
0

answer
286

Views

Ansible win_shell hangs in git pull

I am using win_shell module to remotely execute a 'git pull' command, But it hangs and no returning values to the terminal. My play book - name: connect to web server 1 hosts: windows gather_facts: false tasks: # - name: execute git pull - win_shell: git pull args: executable: cmd chdir : c:\inetpu...
arshadzackeriya
1

votes
1

answer
478

Views

Bitbucket pipelines webpack build and ftp deploy NO JS OUTPUT on the server

I have my pipelines build settings: branches: production: - step: name: Build and test JS. image: node:8.9.3 script: - npm install - npm test - npm run-script build - step: name: Build and test PHP. image: php:7-fpm script: - echo 'Here will be the Composer build and PHPUnit tests.' - step: name:...
Edenwave
1

votes
1

answer
83

Views

git log --before “<date>” not showing commit if followed by one older than <date>

Among other commits I have one dated 2017-12-22 (4b9273bda1680867). But when I run git log --before '2017-12-28 00:00' the newest result I get is dated 2017-12-19 (which is one of the parents of 599241c3003). I suspect that this is caused by 4b9273bda1680 having an ancestor newer than the query date...
fghibellini
1

votes
1

answer
94

Views

How to keep branch up to date without merge/rebase?

I'm new to git so I don't fully understand the system. I've read a whole bunch of articles and explanations here on stackoverflow, and while I believe they answer my question, I don't understand those answers. What I would like is to use git to have a feature branch that never gets merged into maste...
eydryan
1

votes
2

answer
239

Views

Moving the Git Repository to a Child Folder

I'm using Github with my Wordpress website. Currently it tracks the parent Wordpress folder, which essentially tracks everything. I'd like it instead to have a git with only the theme, which is located at wp-content/themes/lighthouse Is there a simple way to have this repository only be the theme r...
James Mitchell
1

votes
1

answer
502

Views

Understanding why Patch created with git diff -w --patience does not apply

I'm trying to clean up a pull request that we received at a project that I admin for. The contributor added a lot of unnecessary white-space changes in along with the functional contribution. He re-indented most of several files. It needs to be done, but it should be a separate commit. I'm not accep...
SailsMan63
1

votes
0

answer
101

Views

R package Installation failed: cannot change working directory

I get the following error message when trying to install package 'rChart' in R: **Installation failed: cannot change working directory** Somebody advised me to install 'Rcpp' before 'rChart'. So I did so. However, it is still same before. > install_github('saurfang/rCharts', ref = 'utf8-writelines'...
Hokun Jeon
1

votes
1

answer
34

Views

XCode and Git: Opening branch in XCode always makes changes to the project file

I just started at a company that uses Git, I was previously at a company that used SVN. We've got many branches off of our master and every time I check one out and open it, XCode makes changes to the project file or to a storyboard, even if all I did was opened it to review. For example, on Branch...
PruitIgoe
1

votes
0

answer
31

Views

Is there a way to limit rerere to certain directories?

I like the idea of rerere, but have some possible concerns that it might potentially cause some issues with other directories that I don't want to have this enabled on. It would seem that this is an all or nothing thing. Is that correct, or can I set it up for only certain directories? I'm conside...
Adrian
1

votes
0

answer
31

Views

How do I disable git subtree pull if nothing is new

I have a git repository subtools that I handle through git-subtree inside my main project sf-parent. I have a problem with the following command git subtree pull -P subtree/subtools subtools v3.0.3 --squash v3.0.3 is a git tag. The problem is that the command never tells me that nothing's new to pul...
smarber
1

votes
2

answer
76

Views

git in IntelliJ IDEA without sacrificing netbeans history feature

Below is the image that shows the feature in Netbeans , where the file changes can be compared by doing the right click and changes can be undone. [ It is the feature that help a lot. I want to Switch to IntelliJ, but i could not find a similar feature in it, if it is available how to get to this f...
Neil
1

votes
0

answer
31

Views

Find modified project file by Visual Studio (SSDT) that is not saved yet

We are facing situation when some developers modify the project file (*.sqlproj) for example by adding or removing objects, then they do not save all the files in the Visual Studio and try to commit/push changes using command line. In that case the *.sqlproj file is not saved yet and it is not caugh...
Dmitrij Kultasev
1

votes
0

answer
460

Views

How to access folders on Desktop from Git Bash

On Windows, I have several folders(one of which is MyFolder) on the Desktop which I would like to open from Git Bash. However, when I run ls /c/Users/myname/Desktop I get only: desktop.ini What is desktop.ini and why does it appear instead of the folders that I have on my Desktop? Also, if I search...
octavian
1

votes
1

answer
236

Views

Git objects not accessible when using pre-receive hook in Bitbucket

I'm struggling to write a pre-receive hook which should verify push basing on existence of marker file. But newref populated by script is pointing into nowhere. I can`t get any data to validate getting: remote: fatal: bad object 3bb1ab6de84c324cd2fb0a7961bd5afccfd77d55 I`m trying to acquire data by:...
Szymon Masłowski
1

votes
1

answer
52

Views

How to rewrite git history to combine commits?

I've been trying to Google this but I think I have a special case and I'm not grasping if there's a way to do this. I started a project in a master branch and when it was stable enough, it was duplicated to a staging branch. Not long after, I decided to create a dev branch from master. Now at this p...
Martavis P.
1

votes
0

answer
130

Views

Missing Git menu on right click

For some reason I dont know why I couldn't see this menu when I make a right click: Git Add all files now Git Commit Tool Git History Git Gui Git Branch Git Bash What I have right now : What I am looking for (inside the red rectangle) : The softwares that I installed : Git-2.15.1.2-64-bit.exe Tortoi...
Joe
1

votes
1

answer
28

Views

Does git track the remote URL if it's changed in .ssh/config?

Assume I have this in /home/ibug/.ssh/config Host GitHub github GH gh HostName github.com User git IdentityFile ~/.ssh/id_rsa PubKeyAuthentication yes And the in a local repo, I run git remote set-url origin gh:iBug/foo Does git remember gh:iBug/foo or [email protected]:iBug/foo?
iBug
1

votes
0

answer
65

Views

Error occuring during squashing the commits

While squashing the commits, I used the command $ git rebase -i master. Also I have specified the text editor to be Notepad ++ and used the command $ git config --global core.editor ''C:/Program Files/Notepad++/notepad++.exe' -multiInst -nosession'. I have a 32-bit processor as I am working with my...
Mridul Birla
1

votes
1

answer
66

Views

Recover damaged git repository

I'm on Win 10 and I have a number of uncommitted changes on my local workstation. I have been using GitHub Desktop. In an attempt to get a 3rd party library to work, thinking the issue was spaces in my path to my project, I changed the folder names to remove spaces in the path to my project. Did...
Rory
1

votes
0

answer
53

Views

Jenkins not applying credentials for git

I'm running Jenkins 2.89.2 in Java on Raspberry Pi 3. I have a git repository located at /srv/git/repo.git, and a user 'git' with full access to this directory. I'm creating a pipeline that should check out the repository, configured like this with correct git credentials. Whenever I try to run a jo...
Mats
1

votes
2

answer
47

Views

PhpStorm Git file adding issue

Problem: 'Git > Add' doesn't seem to do anything, and 'Git > Commit File' says 'No changes detected', when git from the command line sees changes and can commit/push files. Details: I'm using PhpStorm 2017.3.2 (evaluating it) on OSX . I have a project that I've clone from GitHub. Git is configured....
Mehmet
1

votes
0

answer
26

Views

git status not show file mode change even core.filemode is true

My local core.filemode is true, but git status doesn't show any change after I changed file mode. Any idea why ?
GoodToLearn
1

votes
1

answer
64

Views

GitHub Get an email when someone follows me

Maybe I'm missing something super obvious, but I went into my notification settings and can't find anything about getting emails when people follow you. I can always go to my Followers tab on my profile to see who is currently following me, but I'd like to get updates. The only way I found out new p...
SleekPanther
1

votes
0

answer
77

Views

How to use PR on GitHub for Laravel Packages?

When I want to make a pull request for a Laravel package on GitHub I do it at the moment in the following way: Create new Laravel project Require & install the package Delete the add-on files from the project in the vendor folder Fork GitHub and clone files into the project folder Make changes to pa...
Adam
1

votes
0

answer
841

Views

Git LFS pull after checkout results in no step in jenkins pipeline

Problem After enable Git LFS pull after checkout, jenkins pipeline says 'This stage has no steps'. I tried to enable it from either jenkins multibranch configuration or Jenkinsfile (which I name it Jenkinsfile_ios since I have another one for android) but both of their results are the same. I've do...
Yen
1

votes
1

answer
505

Views

how to deal with multiple pull requests merge

Suppose I'm working on feature 1 branch, pushed my code to origin/feature1 branch and put a pull request to develop branch.Another person is working on feature 2 branch, pushed his code origin/feature 2 branch and raised a pull request at same time. when approver approves my request and merges it to...
Anwesh Valleshetti
1

votes
0

answer
173

Views

PyCharm | git pre-commit hook for inserting last change date causes that the file will be flagged as edited (which is the case). Workaround?

I tried to use a git pre-commit hook for inserting informationen about the datetime of the last change to each commited file. The script works fine, but... It seems that PyCharm resets the 'file-has-been-changed-flag' before the git hook executes. Therefore the inserting of the last-checkin-timestam...
sfx2k
1

votes
0

answer
26

Views

Caching git diff results

I have a fairly large git repository on which I need to run repeated git diff commands. For example I need the output of git diff --shortstat commit1 commit2 as well as that of git diff --diff-filter=ad --shortstat commit1 commit2. Is there a way of either caching the diff results in the background...
ARF
1

votes
1

answer
763

Views

git merge: overwrite untracked files

I have a branch with some untracked files in it. I want to merge another branch onto it. The second branch contains a tracked file, which is untracked for the first branch. Following error occurs: error: The following untracked working tree files would be overwritten by merge:... Is there any possi...
ibot3
1

votes
2

answer
38

Views

How does git fetch determine which objects the client is missing?

I always wondered how git fetch determines which objects need to be transfered. The client cannot decide it since it doesn't know which objects belong to the branch and the server cannot decide it since it doesn't know which objects the client already has. I read that the client sends its current st...
jederik
1

votes
1

answer
402

Views

Gerrit Get Content REST API returns 404 (Not Found)

I am trying to fetch the content of a file using the below Gerrrit REST API. Get Content 'GET /projects/{project-name}/branches/{branch-id}/files/{file-id}/content' Gets the content of a file from the HEAD revision of a certain branch. Always it returns 404 not found, Anybody has tried this , Plea...
Bipin Bopaliya
1

votes
2

answer
33

Views

git revert and pull from one branch to another

Have 2 branches (say A & B) merged the changes from A to B (executed git pull . A in branch B). There was a merge commit that happened. Now had to revert that merge on B (so did git revert -m) So due to revert, the commits from A are reverted back in B There are other commits on B done later on Now...
Sudheendra
1

votes
1

answer
19

Views

How to use cloned github repository classes into existing java project

I am using some classes from a github project. I created a maven project and added the dependency from the provided github project, but I need to change some code in those project classes. I have downloaded and modified the repository but now I have no idea how to import it and use the classes to my...
student
1

votes
1

answer
339

Views

git reset --soft HEAD^ is not undoing my commit [duplicate]

This question already has an answer here: git reset asks 'more?' 3 answers I'm trying to undo a commit and duplicate the commit, but when I use git reset --soft HEAD^ (as it was explained to me) it appears this question: More? When it was being explained to me, the More? statement wasn't mentione...
cyber_angel
1

votes
0

answer
203

Views

getting the hooks via scp in git

I am still new to git (one week as we have switched from SVN). We are using egit with Eclipse but I also have git-bash and I am pretty experienced Linux user (in the past). When I tried to push I got the following error: ERROR: missing Change-Id in commit message footer Hint: To automatically insert...
Tony

View additional questions