Skip to main content
Filter by
Sorted by
Tagged with
Best practices
1 vote
3 replies
61 views

First of all, yes, I have read all topics here related to my question. But other questions are based on changes made locally and using command line. I'm asking about this specific situation: working ...
OSWorX's user avatar
  • 138
4499 votes
42 answers
5.7m views

How do I delete a commit from my branch history? Should I use git reset --hard HEAD?
hap497's user avatar
  • 165k
2729 votes
23 answers
1.5m views

If I have an n number of commits, how can I create a branch from the n-3 commit?
dole doug's user avatar
  • 36.4k
1756 votes
21 answers
1.4m views

I have made a git commit and subsequent push. I would like to change the commit message. If I understand correctly, this is not advisable because someone might have pulled from the remote repository ...
K_U's user avatar
  • 18.3k
1244 votes
33 answers
736k views

The answers to How to modify existing, unpushed commits? describe a way to amend previous commit messages that haven't yet been pushed upstream. The new messages inherit the timestamps of the ...
Dhskjlkakdh's user avatar
  • 12.9k
1775 votes
19 answers
1.4m views

I have a Git repository that looks like this: A <- B <- C <- D <- HEAD I want the head of the branch to point to A, i.e., I want B, C, D, and HEAD to disappear and I want head to be ...
Bill's user avatar
  • 46k
2 votes
1 answer
70 views

I have a MariaDB cluster made with Galera and my clients use MaxScale with RW router. I'm having an issue because the application has something this sequential steps: Start trx1 Insert new record ...
Tobia's user avatar
  • 9,605
2042 votes
14 answers
795k views

I accidentally amended my previous commit. The commit should have been separate to keep history of the changes I made to a particular file. Is there a way to undo that last commit? If I do something ...
Jesper Rønn-Jensen's user avatar
1217 votes
18 answers
497k views

Is there a way to list all commits that changed a specific file?
Daniel's user avatar
  • 12.5k
489 votes
21 answers
336k views

I'm trying to review a pull request on GitHub to a branch that isn't master. The target branch was behind master and the pull request showed commits from master, so I merged master and pushed it to ...
lobati's user avatar
  • 10.4k
1030 votes
8 answers
420k views

Is there a way to amend a commit without vi (or your $EDITOR) popping up with the option to modify your commit message, but simply reusing the previous message?
Sridhar Sarnobat's user avatar
943 votes
10 answers
632k views

I ran "git status" and listed below are some files that were modified/or under the heading "changes not staged for commit". It also listed some untracked files that I want to ignore (I have a "....
Steve's user avatar
  • 12.5k
1140 votes
7 answers
892k views

I have made several commits on different files, but so far I would like to push to my remote repository only a specific commit. Is that possible?
Robert23's user avatar
  • 11.4k
285 votes
21 answers
715k views

I'm working on a team with a few developers using Git on Bitbucket. We are all working on a dev branch, not pushing to master until a release. One of the developers committed incorrect code that ...
thanos's user avatar
  • 3,371
507 votes
17 answers
879k views

I was working with a friend on a project, and he edited a bunch of files that shouldn't have been edited. Somehow I merged his work into mine, either when I pulled it, or when I tried to just pick the ...
Joshua Cheek's user avatar
  • 32.1k
356 votes
22 answers
444k views

I ran a git pull that ended in a conflict. I resolved the conflict and everything is fine now (I used mergetool also). When I commit the resolved file with git commit file.php -m "message" I get the ...
pMan's user avatar
  • 9,248
523 votes
14 answers
162k views

Is it possible to see who edited a specific line before the commit reported by git blame, like a history of commits for a given line? For example, I run the following (on the superb uncrustify ...
Aidan Steele's user avatar
  • 11.4k
209 votes
14 answers
550k views

This will be my first git use. I have added new files ( a lot ) to the folder/project ( git local repository). I went through online tutorials and forums and see i can do git commit -a So I go to the ...
kishore .'s user avatar
  • 2,323
602 votes
12 answers
331k views

Is there a way to edit the log message of a certain revision in Subversion? I accidentally wrote the wrong filename in my commit message which could be confusing later. I've seen How do I edit an ...
Paige Ruten's user avatar
723 votes
5 answers
375k views

I find a lot of answers on how to reference a GitHub issue in a git comment (using the #xxx notation). I'd like to reference a commit in my comment, generating a link to the commit details page?
LodeRunner's user avatar
  • 8,493
321 votes
11 answers
182k views

I am curious about how to remove the first commit in git. What is the revision before committing any thing? Does this revision have a name or tag?
Weihang Jian's user avatar
  • 8,945
422 votes
10 answers
103k views

Git treats lines starting with # (hash, number sign, octothorpe, pound sign) as comment lines when committing. This is very annoying when working with a ticket tracking system, and trying to write the ...
knittl's user avatar
  • 269k
889 votes
3 answers
597k views

Sometimes it happens that I make some changes in my working directory, and I realize that these changes should be committed in a branch different to the current one. This usually happens when I want ...
Auron's user avatar
  • 14.4k
0 votes
1 answer
133 views

We use a common git strategy: branch from main to a feature branch. do commits in feature. if main progresses, merge it to feature. merge feature to main. I want to view the changes that happened ...
l000p's user avatar
  • 334
269 votes
6 answers
250k views

I'm trying to delete the last two commits from one of my GitHub repositories. I've tried as suggested here: git push -f origin HEAD^^:master. It seems that it works, as the last two commits are ...
Ivan Fernandez's user avatar
483 votes
2 answers
183k views

I'd like to get the number of commits per author on all branches. I see that git shortlog -s -n Prints a very nice list but it is not counting the commits that are not yet merged from other branches. ...
jabal's user avatar
  • 12.5k
511 votes
4 answers
419k views

I am fairly new to Github and have come across an amateur-ish problem. I have been asked to do a code review and have been provided with a commit hash, however I have tried looking in Git if I can ...
dopplesoldner's user avatar
786 votes
1 answer
504k views

Possible Duplicate / a more recent/less clear question Branch from a previous commit using Git I have a Git branch called jzbranch and have an old commit id: a9c146a09505837ec03b. How do I create ...
JZ.'s user avatar
  • 22.1k
238 votes
10 answers
90k views

Is there a way to see the date of a commit in github, with day/hour precision? Older commits appear in a "human readable" format, such as "2 years ago" instead of showing the actual date. If it's not ...
loopbackbee's user avatar
  • 23.6k
304 votes
4 answers
176k views

I'm developing a django app and I'm using pip to manage my requirements. How can I do to install a specific git's commit? In my case I need to install this commit: https://github.com/aladagemre/...
kelwinfc's user avatar
  • 3,411
1 vote
1 answer
3k views

I am interested in using GitHub Copilot to help generate commit messages for my project. I have heard that it can provide suggestions based on specific commit message instructions. However, I am not ...
Simon Skoda's user avatar
339 votes
5 answers
91k views

Say I have a file foo.js that was committed some time ago. I would like to simply find the commit where this file was first added. After reading the answers and my own tinkering, this works for me: ...
Zombo's user avatar
  • 1
11 votes
3 answers
19k views

git push -u origin main error: RPC failed; HTTP 400 curl 22 The requested URL returned error: 400 send-pack: unexpected disconnect while reading sideband packet fatal: the remote end hung up ...
Mohit Sapat's user avatar
23 votes
4 answers
37k views

I'm trying to clone using HTTPs a repository (sample.com/component.git) but from a specific commit ID. Should I fetch the repoistory, then checkout that commit ID and finally clone it, or what would ...
tadm123's user avatar
  • 8,899
244 votes
9 answers
262k views

Is there any way of online editing the commit message in GitHub.com, after submission? From the command line, one can do git commit --amend -m "New commit message" as correctly suggested in ...
PNS's user avatar
  • 20.1k
265 votes
5 answers
171k views

How can I make a new commit and create a new message if no changes are made to files? Is this not possible since the commit's code (SHA ?) will be the same?
d-_-b's user avatar
  • 23.2k
7 votes
1 answer
3k views

I use Windows and IntelliJ IDEA 2024.2.4. (Ultimate Edition) I've been looking at all options and I do not find anything where I can change this behaviour... When I commit I see a window which does ...
Patrick Rode's user avatar
236 votes
6 answers
241k views

Trying to learn GitHub at the moment and doing this Git essentials tutorial over at nettuts. I'm on the lesson about making commits. The teacher types git commit and it opens VIM as his editor (I'd ...
Leon Gaban's user avatar
  • 39.4k
299 votes
3 answers
197k views

If you want to move a commit to the staging area - that is uncommit it and move all of the changes which were in it into the staging area (effectively putting the branch in the state that it would ...
Jonathan M Davis's user avatar
0 votes
1 answer
45 views

Suppose I have a branch B1 that added files A, B, C, ..., Z. Suppose I am at branch B2. What I want is to get a subset of files (say A, E, I, O, U) from the latest state of B1 and create a commit in ...
Daniel's user avatar
  • 7,800
0 votes
1 answer
447 views

I'm have one update file in project. But it's very long time updated. Antivirus windows deactivated. What could be the problem? Intellij IDEA Community. I'm try off my antivirus and reload Intellij ...
hotabmax's user avatar
25 votes
3 answers
45k views

I need to change an old commit message. Considering that I've made a few other commits afterwards, is there a way to change it, via git or directly on GitHub, without interfering with the other ...
user avatar
227 votes
8 answers
118k views

I'm looking for a counter-part of git commit --amend in Mercurial, i.e. a way to modify the commit which my working copy is linked to. I'm only interested in the last commit, not an arbitrary earlier ...
mstrap's user avatar
  • 17.6k
174 votes
10 answers
229k views

I'm trying to commit some changes as a different user, but i do not have a valid email address, following command is not working for me: git commit --author="john doe" -m "some fix" fatal: No ...
Willem D'Haeseleer's user avatar
62 votes
3 answers
59k views

Following Conventional Commits what would be the best <type> for commits regarding package version changes (upgrades/updates)? E.g.: feat: Bump React version to "16.13.1" E.g.: feat: ...
Gustavo Máximo's user avatar
447 votes
5 answers
266k views

The situation: master is at X quickfix1 is at X + 2 commits Such that: o-o-X (master HEAD) \ q1a--q1b (quickfix1 HEAD) Then I started working on quickfix2, but by accident took quickfix1 ...
Alex Yarmula's user avatar
  • 10.7k
275 votes
4 answers
617k views

I've only just started to use Git and think it is wonderful, however I'm a little confused over what the merge command does. Let us say we have a working project in the branch "A". I go home ...
dotty's user avatar
  • 41.7k
186 votes
8 answers
148k views

This is mostly a git question. I want to commit my ipython notebooks but gitignore the checkpoints. The repo has multiple folders which each have ipython notebooks, therefore just ignoring a single ...
sapo_cosmico's user avatar
  • 6,582
0 votes
1 answer
114 views

Azure DevOps Repos, situation is really simple, we have Branch Master ---+---+ Head Branch Develop ---+---+ Head + ... + changes After some commit on Develop, we create pull request from ...
Domenico Monaco's user avatar
122 votes
11 answers
78k views

I'm using Eclipse Juno on Mac 10.7.5, SVN 1.7 and the Eclipse Subversive plugin. Occassioanlly, when I try and commit changes from my project (by right clicking on the project from the package ...
Dave's user avatar
  • 20.1k

1
2 3 4 5
68