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

What to do after git reverse?

I am trying to go back N commits in the repo. Following this answer, I did git revert HEAD~N..HEAD Now what do I do? I expect to be able to checkout -b and then push and do a pull request, is this ok? I don't want to mess up.
user3808307
  • 2,270
  • 9
  • 45
  • 99
1
vote
0 answers

git move unpushed committed changes to a remote branch, work on master, then go back to the branch

I am new to git. I have 10 commits (git status shows I am ahead of origin/master by 10) with lots of code. I have not pushed yet. After committing changes I did a git pull, resolved all conflicts and then git add and then git commit again which was…
bsobaid
  • 955
  • 1
  • 16
  • 36
1
vote
1 answer

git diff exclude merge - commits

I'm trying to list all changed files inside branch FEATURE-1 ignoring it's merge commits to the branch DEV, from which it was originally created using git diff. So the graph looks like this: x---y---z---w---feature / / …
1
vote
0 answers

Save data generated from Rstudio to git automatically

I have an R function that generates a data from, say, an API. And i want to save the generated data automatically on my Git repo. I have some logic like below: git_commit = function(a,b) { x = get_data(a,b) return(x) …
Ian
  • 157
  • 1
  • 7
1
vote
1 answer

Trigger a Jenkins job after commit on different repository

I have a pipeline job on Jenkins which run tests and it's linked to repository 'A', I want to trigger this job once in repository 'B' a commit done. Is it possible?
1
vote
1 answer

What is the difference between these 2 Looping Delete queries in SQL Server

I want to find the difference between doing a delete query in a while loop one with begin transaction and one without.I am trying to delete 200 million rows out of 250 million and keep running something like this in the background. I can't truncate…
Maknora
  • 21
  • 2
1
vote
1 answer

Is there a way to know if a commit date was modified?

I'm doing classes in a university course and one of the tools we teach and use is VCS, GitHub to be precise. So, for the students to learn how to use Git and for us to be able to track a student's progress we make them submit their homeworks via…
Roäc
  • 149
  • 19
1
vote
1 answer

Pentaho "Make the transformation database transactional" plus commit frequency

By using Make the transformation database transactional property, If I get it right, a single commit is done at the end of the transformation (or rollback if there is an error or an abort) However, the Commit size is still avaiable on the table…
Julio
  • 5,208
  • 1
  • 13
  • 42
1
vote
1 answer

Best practice Git

I want to understand the "best" way to handle the following common scenario in a GIT world. My Scrum Sprint has just started and I start working on my User Story. For that User Story, I have to implement a new class ("FakeClassA") and expose 10…
vt89
  • 151
  • 2
1
vote
1 answer

git modified content error during git commit

Update -1 This is what i am trying to do. cd /tmp git clone http://git.example.com/foo/openstack.git -b ansible-roles ansible-roles-new cd ansible-roles-new cp -r /etc/ansible/roles /tmp/ansible-roles-new After that i did git commit -m "foo..." and…
Satish
  • 16,544
  • 29
  • 93
  • 149
1
vote
2 answers

Want to delete all commits from a branch in git

I have messed up my branch and I want to delete all commits from it now, without deleting the branch itself. Is there any way in git we can do that?
Pratik
  • 1,351
  • 1
  • 20
  • 37
1
vote
1 answer

2PC as solution for compensation in distributed transactions

I'm comparing Saga and Two-Phase Commit My analysis about 2PC is if in prepare phase I persist the data in a pending state, I could avoid a lockin in my transaction and in the final phase commit my changes. Obviously the cost is 2x against Saga…
Jean Carlos
  • 1,613
  • 3
  • 18
  • 26
1
vote
1 answer

SQLAlchemy Ideal Design for Committing

I have a Pylons back-end running on SQLAlchemy. I have a script that reads a tree of XML files from an HTTP server (it downloads an xml X, and then downloads that X's children, and then iterates the children, and so forth in recursion). Each xml…
Raiders
  • 181
  • 2
  • 7
1
vote
0 answers

The commits extracted from GitHub API are different than the commits I get from git.Repo for the same project

What I am trying to do is: I want to extract the name of classes that have been modified in a pull request. To do that, I do the following: From GitHub API: 1) I extract all the pull requests for one project 2) I extract all the commits for each…
nightrain
  • 306
  • 1
  • 3
  • 13
1
vote
1 answer

remove multiple commits from multiple merged branches

Someone gave me a repo to work on. I assumed it's a company repo and I hapilly started creating branches , then finally I merged them into a single one , deleted the temporary branches and pushed. Today he messaged me that is his personal repo, so…
cmu111
  • 25
  • 4