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

Remove need for Github Personal access tokens for push authentication

I have a Github account with Personal access tokens setup in Developer Settings. I would like to revert back to just needing to use the Github password for push authentication. Does anyone know where the option is to do this? Thank you.
hillodesign
  • 45
  • 1
  • 11
1
vote
1 answer

Is possible modify an earlier file pushed without a new push

I need to update an earlier file but I need to modify it in the place that it was update before, is it possible? ... commit A (Add fileA, Add fileB) --> commit B (update file B) ...--> HEAD I need to go to commit B and rewrite the file and keep the…
1
vote
1 answer

`git branch --contains` does not show branch that originated commit

I wanted to test git branch --contains, so I found a commit from a branch that I had not checked out before, older-branch. On a different, more current branch (lets call it newer-branch), I did git fetch to make sure I was up-to-date with upstream.…
maddie
  • 1,854
  • 4
  • 30
  • 66
1
vote
1 answer

Undoing changes made to local file with git

I have two branches of my project: master and live. I made some changes to my local files and when i was done, i wanted to push the changes to master. I never knew the current branch on git was live. I ran: git add . git commit -m "integrated…
Lord_Sarcastic
  • 197
  • 2
  • 10
1
vote
2 answers

Git log current branch messages only in order of commits

Find a way to get only the git commit messages but only from the current branch and also in the order of commits.
Noam Segev
  • 51
  • 6
1
vote
1 answer

Jenkinsfile syntax: Commit to Subversion SCM repository from workspace

Somehow, I could not find an example of declarative pipeline syntax (Jenkinsfile) for this case. The idea is very simple. There is some local file in Jenkins pipeline workspace that was checked out from Subversion SCM repository at the beginning of…
1
vote
2 answers

How do I pull/cherry-pick a gerrit commit/patch to a branch using a http link to the commit?

I'm trying to pull a particular gerrit commit/patch to a branch. I'm not too familiar with gerrit but it seems like for usual case there are things called "patch" which are like a group of commits lumped together. In most cases I see some steps…
John Doenut
  • 185
  • 3
  • 11
1
vote
1 answer

Git push again the same commit to remote

My project has a remote and local synchronized repository. I did locally new branch -> than committed and pushed to the remote. Next, I have unaware deleted remote branch - operation is impossible to undo(in Gitlab). So, locally I have everything…
pawchi
  • 77
  • 7
1
vote
1 answer

How to keep the last commit of every day

I have written a simple script to git commit the changes every hour and push the changes But I want to keep only the last commit of each day and remove the previous ones due to the size of commits to save the space. In other words, I need to keep…
1
vote
0 answers

Exclude project files from rules in Git hook [commit-msg]

I am writing a Git hook in file commit-msg using python. Purpose is to make sure that commit messages contains the type of work done with code to better manage CI/CD pipelines, like "Debug-activity performed: " OR "Test-activity performed: " Now…
1
vote
1 answer

git rebase a branch when it has merged a remote branch

My PR to a branch on github shows commits as the following: - "commit msg 1" - "commit msg 2" - "Merge remote-tracking branch 'upstream/dev' into this branch." - "commit msg 3" - "commit msg 4" - "Merge remote-tracking branch 'upstream/dev' into…
Dr. Strangelove
  • 2,725
  • 3
  • 34
  • 61
1
vote
1 answer

How to find a comment entered in Visual Studio when protecting a file

I have a problem. Normally when I protect files in Visual Studio, I add a comment (I enter a code). Now I want to look for that code to see what files I protected at that time but I don't know how to do it. Can somebody help me? enter image…
Bibi Ruiz
  • 19
  • 6
1
vote
3 answers

How to push a specific commit to a repo, not including the previous commits, without the history?

I'm trying to push a specific commit to an upstream repo, which is the same as the one I'm working on, but with slight changes. The current repo is ahead of the upstream one and I want to push some of the changes I made in the current repo, but not…
Aerodynamika
  • 7,883
  • 16
  • 78
  • 137
1
vote
1 answer

Is there a way to change email id for already commited stuff on github?

I have been using GitHub and Bitbucket for different repositories. For my Github repo, I realized later that I have been using bitbucket email to commit and push on to Github. I am not sure if it is possible to change those already pushed commits to…
minion
  • 75
  • 1
  • 6
1
vote
0 answers

Why is not completed transaction in Spring boot on TransactionStatus?

I don't know why is transaction is not completed. Example) public void transactionMethod() { DefaultTransactionDefinition txDefinition = new DefaultTransactionDefinition(); …
SD.LEE
  • 31
  • 4