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
2 answers

How is git log organizing my commit history after merging 2 branches?

I have two git branches that produce logs like so: Branch A commit xyz @ 11:00 am commit yut @ 11:10 am commit mot @ 11:30 am Branch B commit xyz @ 11::00 am commit shu @ 11: 20 am commit yam @ 11: 40 am Merge Branch B to Branch A Now when i…
nodumbqs
  • 91
  • 1
  • 6
1
vote
2 answers

GIT SHA id of a file on remote git branch

I would like to know if there is any command available to get the SHA id of a particular file on a given specific git branch on the GIT remote server? Thanks, Srinivas
Srinivas
  • 321
  • 2
  • 5
  • 18
1
vote
2 answers

Which files of a NetBeans project should be committed to repository?

I was wondering which files of a project should committed to a repository. For example, i've created the gitignore file for a project of mine, a java web app created with NetBeans. On gitignore.io i put the netbeans tag but i noticed that there's…
Filipp
  • 105
  • 8
1
vote
1 answer

Recover from Messed up commit to wrong origin

I have an eclipse workspace with directories for various projects:project1, project2 etc. So i created a project1.git in a dropbox folder. I work on my code in project1, my working directory. I have git remote added "project1.git" as origin. So,…
hAcKnRoCk
  • 1,118
  • 3
  • 16
  • 30
1
vote
2 answers

Git update branch after changing parent

I currently have a few branches that are based on each other. We're also using Gerrit. master \- A \- B There are actually four in total but to explain my problem two should suffice. My problem is as follows: I've made changes to A and…
matthesinator
  • 136
  • 1
  • 8
1
vote
1 answer

Jenkins Git, Get all commits in the last Push in Pull Requests

I have a Job looking for PRs in github and I want to know which folder was changed since the last push, because I need to execute different commands. I have this command: git diff --quiet --exit-code HEAD~1..HEAD api || echo > api.changed git diff…
Alan Grosz
  • 1,175
  • 10
  • 15
1
vote
2 answers

can't commit changes in xcode 4

i set up a project to be on version control. I imported the project without problems to the server repository. Now, when i commit changes, they seem to be committed as i don't get any errors and it says "Committing" but when i go to check the…
madcoderz
  • 4,423
  • 10
  • 47
  • 74
1
vote
1 answer

Tortoise SVN commit query

I am new to tortoise SVN and I did SVN commit for multiple files related to each other seperately. This has created a separate revision number for each file. How can I correct this? Ideally I would want all the files to have same revision…
BT12
  • 13
  • 2
1
vote
1 answer

"Commit" option with the green check mark icon not appearing in Subversion tab IntelliJ

I've ran into a problem where in IntelliJ Settings->Appearance & Behavior->Menus and Toolbars->VCS Local Changes Toolbar I see the "Commit" option with the green check mark icon. However, the green check mark is not showing up in the 9.Subversion…
infiniteshi
  • 131
  • 1
  • 5
1
vote
1 answer

Remove build from PR in Bitbucket using API

i have a project with two submodules - one is for the source code(A) and the second one contains end to end tests(B). The problem is that the build of the source code is successful, but e2e tests are failing and this does not allow me to merge. Is…
Bozhidar Marinov
  • 116
  • 2
  • 15
1
vote
0 answers

How to use git log -L /regex/ with linebreak?

Git documentstion https://git-scm.com/docs/git-log says that there is a command git log -L ,: "start" and "end" can be number, /regex/, +offset or -offset. I am looking for commits that modify a piece of code matching the regular…
Maria
  • 21
  • 3
1
vote
2 answers

Xcode4 and SCM (Subversion) - Group/Folder not under version control

I have an Xcode4 project which is under Subversion SCM. The initial directory structure looked something like…
Mustafa
  • 20,504
  • 42
  • 146
  • 209
1
vote
1 answer

Pushing Files to a particular directory of a Github Repository using Git Bash/Terminal

I have an existing repository in Github. But how do I commit changes and push the files to a particular directory in that repository? Note - I've done all the steps from git remote add origin to 'git commit' to 'git push` but, how do I select that…
Rahul Bordoloi
  • 145
  • 3
  • 9
1
vote
0 answers

Git commit button disabled on pycharm

I decided to upload my code to git. Created repository and pushed through Windows cmd. Now I want to work directly via Pycharm. I logged into my github account. When I change a file its name becomes blue (I know it means that it's different from the…
gozi
  • 63
  • 6
1
vote
3 answers

Git - Remove commit from history but lesve the code

I am using git on VS2019 I was wondering if there is a way to remove old commits but always keep the latest code. The reason is that when I work on a big change, I do a lot of commits after checking every small step but at the end it is annoying…
user11354125