FAQ Database Discussion Community


Why reverted commit won't show in new PR?

git,github,git-commit,pull-request,git-revert
Here's what's happening: created branch XYZ from master committed changes in branch XYZ made PR of XYZ branch to master PR got accepted and code merged into master PR got reverted (it broke stuff) made some commits in branch XYZ in order to fix what commit on item #2 had...

Differences between Commit, Commit and Push, Commit and Sync

c#,git,svn,github,git-commit
I'm using visual studio 2013 and I'm faced with 3 options for when I commit my C# code. I need a basic explanation on the differences between each of the options in terms of what happens to my local repo vs the github repo. Option 1 says Commit Option 2...

Removing subproject commit from github

git,github,git-commit,subproject
I have two repositories namely A and B. By mistake I cloned repo B inside A on my machine. I removed all the code from the repo B but when I pushed and merged my code from A on origin, it also shows a subproject commit B on Github repo....

How do I delete all the local Git commits I've made?

git,github,git-commit
I need delete all local commits from a Git project. I need to do so that I can commit everything as a single unique commit before sending it upstream.

Remove empty commits in “git”

git,version-control,git-commit
I just migrated a project from mercurial to git. However, mercurial does add empty commits when you add tags, so I ended up with empty commits in git that I would like to remove. My question is, how do I remove empty commits (commits that do not have any files...

How to merge a git branch that results in only a single commit (like using --squash), but allowing future merges without conflicts?

git,git-merge,git-commit,git-conflict-resolution
I have a branch with many commits in it since creating it and would like to make a single merge commit to move it back to master, usin a single commit. So the only solution I know if is to use git merge --squash branchname. This works well, but if...

Fix All Commit Messages in Git

git,git-commit
I am in process of migrating a subversion repository to git. We enforce a commit message format like so: [#<Issue Number Here>] The commit message. During the migration, I noticed that some people put a new line into the commit message like this: [#<Issue Number Here>] The commit message. I'll...

Git commits reset unknown to my name

git,github,commit,git-commit
I changed my desktop(old to new) and forgot to add gitconfig file with username and email. I commit and pushed lot of stuff on github from the last 1 month but didn't noticed my name was unknown. Is there anyway i can reset that commits username from unknown to mine....

git remove a file that no longer exists on the system

linux,git,git-commit,git-add
I have never encountered this problem before and have no idea how this is possible. I had a really large directory that I downloaded by mistake into my git repo. I inadvertently did a git add . so the large directory got added to the working tree and when I...

Why am I getting “Commit failed with error: pathspec … did not match any file(s)”?

git,git-commit
I am having some issues with Git. I have a repository where I can commit any file to without problem. However, there is a single file 'Funder.php' which, when I try committing, tells me there is an error as: Commit failed with error: pathspec 'application/libraries/Funder.php' did not match any file(s)...

How to clone previous repo version to local machine?

git,github,command-line,git-commit,repo
I accidentally deleted all internal files from online GitHub repo - directory is now empty but still in existence - PLUS the repo has been removed from local machine as well Normally a GitHub clone would be used to get repo back on machine, git revert etc for online version,...

Git: pre-receive hook to allow only merges and not direct commits into master

git,git-merge,githooks,git-commit
I have a problem creating a pre-receive hook on a git remote branch, doing what I want. What's the problem? Direct commits to the master branch should be not allowed. Only merges into the master branch should be allowed. Solution My solution until now is to check, if there are...

GIT Error:- expected committer email '' but found '[email protected]'

git,commit,git-commit,git-config
Git push is getting rejected with the following error message: expected committer email '' but found '[email protected]' I have already tried: setting use properties in .gitconfig file. trying git push making different clones of same repository. setting up whole system all together after formatting it. But none has worked. What...

GIT: remove commit halfway down in log but keep all overs

git,git-commit,git-revert
Hi I have a commit in my git repo which I want to remove, but I want to keep all other commit thereafter. df5bf4b != 'Test' to =='Test' c1f6f9f fixed occupations getJob to check if is empty 4e818fa added utility links partial to client template. Remove old utility links f954acf...

Git how to not include specific file(s) to commit

git,gitignore,git-commit
Im trying to not include some files to be commit. For example, I don't want any change in the following files to be included in a commit: bootstrap/start.php So I include them in .gitignore like this: /bootstrap/compiled.php /bootstrap/start.php /vendor composer.phar composer.lock .env.local.php .env.php .DS_Store Thumbs.db.idea .idea/ /public/dbase /public/user_images /app/config/lenovo but...

Git commit --amend merged two commits

git,git-commit,amend
I have a remote 'dev' branch and was working on it locally. I made a first commit on 'dev' with a commit message "my_feature", putting my local branch ahead of the remote by 1 commit. I then developed some new stuff and made a git add -u, getting ready to...

Revert commits back after the head was changed and pushed

git,github,git-push,git-commit,git-reset
I've committed some bad code a few days ago and today I changed and pushed an older head to master. Before changing head: commit 4 commit 3 - bad code starts here commit 2 - i set the head here and pushed commit 1 After changing head: commit 2 -...

Git remove specific files from all previous commits

git,git-commit
I started a small project (10mb) and as it grew and produced output images it grew exponentially (to 12 gb). I realize I was uploading my images which are not part of the code. I removed them, added a rule not to upload images and kept commiting. Problem is now...

Can git ever send your code to a repo that isn't yours?

git,github,git-commit,git-add,git-init
Can running git add . git commit -m "message" in a git repo which you've initialized using git init ever result in your code being sent to a repo that is not yours? I am concerned because I did this while not logged in to my git hub account....

git commit specific staged deleted file

git,git-commit
I removed a file from my git repo (git rm a) and made a change to another file (b). I also have a bunch of other changes lying around, but I want to specifically commit those two in one commit and deal with the rest later. My status is basically:...

Unable to find branch in git repo

git-branch,git-commit
In the current directory. I had made a repository yesterday from this directory. now: git branch foo After doing some changes in the file.. git add . git commit -m "commit1" git push. I am unable to see the branch from my repo on github. While git branch does show...

Git - Adding files to the index without committing them

git,git-push,git-commit,git-add
I am working in a project of around 50k files, of which I am only modifying a few of them. I have the project locally in my computer and I am using Gitorious to push the changes I make to it, but as for now I have to manually look...

LibGit2Sharp get repository changes after pull

c#,git,git-commit,pull,libgit2sharp
How can i get the following information after a git-pull with libgit2sharp: Which files has been moved Which files has been created Which files has been deleted The git-pull request it self works perfectly: var result = repo.Network.Pull(new LibGit2Sharp.Signature("admin", "[email protected]", new DateTimeOffset(DateTime.Now)), options); I already looked at the result of...

SourceTree - remove waiting pushes

git,push,commit,git-commit,atlassian-sourcetree
How do I remove commits, waiting to be pushed to remote? My situation is, that those queued commits (changes) been already pushed (more bellow) and now the server refuses to accept those as they are behind the HEAD. I tried resetting to another commit, but when I go back to...

How to replay a commit onto a branch that already contains the commit?

git,git-branch,git-commit
Lets say our commit history looks like 1--2--3--4 ^ HEAD Where 4 is the most recent commit. Is there a way to replay the changes from commit 2 (the differences between 2 and 1) onto commit 4? You are probably wondering why anyone would want to do that. Lets say...

Squash commit message in master branch

git,git-push,git-commit,git-squash
In Git after last push to remote repo I worked on master branch. I have 6 commits to push now. I want to squash these 6 into 1 commit message then do push. Any suggestion? ...

Git wrong commit time stamp

git,github,timestamp,git-commit
I was trying to push some changes to a forked copy of a repo. At the time of the commit my system date was wrong and ahead of one day. Now after the upstream repo merged my changes, my commit time stamp is ahead of the actual merging time stamp....

Git - Commit file in .gitignore

git,gitignore,git-commit
I want to commit and push two new files that are inside a folder that is listed in the project's .gitignore. I figure I can just change the .gitignore file, but then I would require two commits: one commit to push the two new files, and a second commit to...

Git: Automatically Commit on Publish or Restart of Web Aplication

eclipse,git,weblogic,egit,git-commit
When developing on my local, I would like to automatically commit all outstanding changes to Git every time I republishing my web project in Eclipse. This way I can get a good view of the steps that I took in my development activities. I will of course rebase before pushing...

How do I see a commit's path through git history, or “how it got in the current branch”?

git,git-commit,gitk,git-history-graph
I'm looking in the commit history using gitk and git log and I'm trying to see how a specific commit arrived in a certain branch. I can see the commits in the history, so I know they are there. What I want to understand is how they got merged (they...