Questions tagged [commit]

Questions about committing a transaction or "unit of work" to a database, application or version control system.

The usual context of this tag is application and/or database transactions but it is also applicable to version control software.

Within the application/database context, a commit means that all state changes made during the current transaction are made permanent.

Within the context of version control software, the "unit of work" being committed is the total change being written to the central store. Usually, "commit" refers to the command used to perform this action (e.g., git commit or svn commit).

The nature of different source control systems lead to different styles of committing. However, there are generally two agreed upon practices:

  1. Commit only single units of work (fixing a single bug, adding a single feature, etc.) - this makes history easier to walk through. Conversely, avoid making large, sweeping commits, which pollute history.

  2. Commit messages should be fairly concise and clear. This makes understanding who has done what (typically done using a command like blame) easier. This practice is an extension of the first, because single units of work are easier to write clear commit messages for.

Beyond these two guidelines, the majority of workflow is determined by how distributed a version control system is. Generally speaking, what goes into a centralized system like Subversion is much more strictly controlled because it is harder to undo; most commits in a centralized system involve running a project's entire test suite.

Distributed systems like Git tend to be less strict about what is committed, because it is the author who chooses when to push commits to a remote repository and can run test suites before choosing to push their changes; also, any mistakes can be reversed by editing private history.

3350 questions
1
vote
1 answer

Why I'm I getting merge conflicts on files I didn't even touch?

I'm working on a branch > my-branch. When I'm ready to merge with develop, I commit my code and switch to the develop branch. I do a git pull origin develop, then pull develop and switch back to my-branch and do a git merge origin develop. I'm…
Tellisense
  • 1,858
  • 12
  • 11
1
vote
0 answers

Cloning a specific commit of a branch from GitHub using Git Bash

As we have committed a lot of work inside a branch sometimes we want to go to the branch and go back to several works behind the latest update. I am trying to use the Git Bash but I can only do the cloning of the commit by downloading its zip file.…
Genoske
  • 49
  • 5
1
vote
0 answers

How to search a Git repository by content (i.e., a regexp in across all previous states of a repo, not just commit messages)

That is basically it: I would like to search for a specific expression across all the previous states of my repo. I have read that one can search all past commits one by one or searching for the commit message, but not for content. Before using git…
1
vote
0 answers

PhpStorm: Log tab (Version control) doesn't show changed files

I don't know exactly what happened but somehow now when I go to the Log tab on the Version control menu at the bottom in PhpStorm and select a commit, I cannot see the files changed in that commit anymore, just the text for the commit. I somehow…
Xulvi
  • 21
  • 3
1
vote
1 answer

How to create master branch in remote repositories?

I encounter an issue when I create a bare repository. Here is my step: Create a folder named Test in a C:\ as a remote repository Create repository in sourcetree and select C:\Test Input command git init --bare in terminal Clone C:\Test to my local…
WILLIAM
  • 457
  • 5
  • 28
1
vote
1 answer

git reset --hard ~1 too many times, deleted files

I was trying to squash my commits and went too far back, now all my files have been deleted. I attempted a git reset HEAD@{0} but this ended up with a "Unstaged changes after reset:" and a list of the DELETED files. The files had not been restored.…
1
vote
1 answer

How to view github commit history locally on Mac OS X

I'm trying to view the history of a file on GitHub locally on my Mac OS X laptop because GitHub tells me "Sorry, this commit history is taking too long to generate." (see URL…
slantalpha
  • 515
  • 1
  • 6
  • 18
1
vote
2 answers

Eslint blocking commit, terminal is stuck on "running eslint..." forever

I'm working on react project which has integrated eslint. It works great and if I try commit code that is not compatible with eslint i get errors and commit is stopped. Although when I don't have any errors I just get message "running eslint...". I…
Alisec
  • 63
  • 1
  • 4
1
vote
2 answers

What are "BIN" files on github?

I wanted to upload some .java files on github, I don't remember if I uploaded the right files. I have been told that the files I should've submitted were missing. I checked the last commit, and the files I should've submitted were marked with "BIN"…
Ana-Maria
  • 139
  • 1
  • 11
1
vote
1 answer

Azure Repos - allow co-workers to submit without pushing

I created an Azure repos (the first of my life ;-) and I have invited people to work on the project. They have a microsoft account. This is the free Azure environment. I want to be notified when they submit their work and accept or reject it before…
Hmatt
  • 35
  • 4
1
vote
2 answers

How to check git commit is from cherry-pick, and from which one?

Can we know any git commit is from cherry-pick, and from which commit?
kevin
  • 11
  • 3
1
vote
1 answer

please , what i can do to resolve this issue when i want to commit from eclipse to github?

Can't connect to any repository: https://github.com/KJ-jamila/Alten.git (Duplicate remote ref update is illegal. Affected remote name: refs/heads/master)
1
vote
1 answer

How can I commit permission changes?

I'm working on a ClearCase repository. Some of the files in it have, for some reason, execution permissions while they shouldn't (they're text files basically). I'll also mention I'm a user without root privilege. If I check them out, change their…
einpoklum
  • 118,144
  • 57
  • 340
  • 684
1
vote
1 answer

How to delete specific commit histories in Github created via file upload?

I normally upload my files to Github repository through the web interface. I accidentally uploaded a file to Github repository recently and this file contains information which I don't want others to see. Now, this private info is permanently…
user3848207
  • 3,737
  • 17
  • 59
  • 104
1
vote
1 answer

Git hook rule to not allow push if CSS specific property is not meet the consition

I would like to find the way for git hook to prevent commit and push if the z-index has been use and the value if below 1000. But I did google for it but I could not find any suitable solution for it. Do you have any solution for it? Many thanks in…
AJ-
  • 1,027
  • 2
  • 13
  • 24