Tag: r

48 votes
16 answers
559 views
How to modify a specified commit?

I usually submit a list of commits for review. If I have the following commits: HEAD Commit3 Commit2 Comm

avatar
Mikki
0 1 0 9
asked 07 September, 2021
61 votes
21 answers
994 views
Ignore files that have already been committed to a Git repository

I have an already initialized Git repository that I added a .gitignore file to. How can I refresh the fil

avatar
Wilber
0 1 0 9
asked 07 September, 2021
53 votes
12 answers
1.3K views
What does cherry-picking a commit with Git mean?

Recently, I have been asked to cherry-pick a commit. So what does cherry-picking a commit in git mean? How d

avatar
Solomon
0 1 0 9
asked 07 September, 2021
54 votes
25 answers
3K views
Git refusing to merge unrelated histories on rebase

During git rebase origin/development the following error message is shown from Git: fatal: refusing to merge

avatar
Hildegard
0 1 0 9
asked 07 September, 2021
50 votes
15 answers
392 views
I ran into a merge conflict. How can I abort the merge?

I used git pull and had a merge conflict: unmerged: _widget.html.erb You are in the middle of a conflicted

avatar
Majorie
0 1 0 9
asked 07 September, 2021
58 votes
29 answers
3.1K views
How do I make Git use the editor of my choice for commits?

I would prefer to write my commit messages in Vim, but it is opening them in Emacs. How do I configure Git to

avatar
Hallie
0 1 0 9
asked 07 September, 2021
48 votes
30 answers
516 views
How to get the current branch name in Git?

I'm from a Subversion background and, when I had a branch, I knew what I was working on with "These worki

avatar
Santiago
0 1 0 9
asked 07 September, 2021
50 votes
30 answers
2K views
Message 'src refspec master does not match any' when pushing commits in Git

I clone my repository with: git clone ssh://xxxxx/xx.git But after I change some files and add and commit

avatar
Luis
0 1 0 9
asked 07 September, 2021
64 votes
12 answers
1.8K views
Remove a file from a Git repository without deleting it from the local filesystem

My initial commit contained some log files. I've added *log to my .gitignore, and now I want to remove th

avatar
Benton
0 1 0 9
asked 07 September, 2021
58 votes
24 answers
519 views
How do you create a remote Git branch?

I created a local branch which I want to 'push' upstream. There is a similar question here on Stack

avatar
Rudy
0 1 0 9
asked 07 September, 2021
59 votes
9 answers
546 views
Move existing, uncommitted work to a new branch in Git

I started some work on a new feature and after coding for a bit, I decided this feature should be on its own b

avatar
Chelsea
0 1 0 9
asked 07 September, 2021
57 votes
7 answers
2.4K views
How do I clone a specific Git branch?

Git clone will behave copying remote current working branch into local. Is there any way to clone a

avatar
Tuan
0 1 0 9
asked 07 September, 2021
54 votes
19 answers
474 views
Undoing a git rebase

Does anybody know how to easily undo a git rebase? The only way that comes to mind is to go at it manually:

avatar
Shantay
0 1 0 9
asked 07 September, 2021
53 votes
30 answers
3K views
Delete commits from a branch in Git

I would like to know how to delete a commit. By delete, I mean it is as if I didn't make that commit, an

avatar
Don
0 1 0 9
asked 07 September, 2021
58 votes
22 answers
3K views
Make an existing Git branch track a remote branch?

I know how to make a new branch that tracks remote branches, but how do I make an existing branch track a remo

avatar
Sena
0 1 0 9
asked 07 September, 2021
57 votes
30 answers
956 views
Squash my last X commits together using Git

How can I squash my last X commits together into one commit using Git?

avatar
Tana
0 1 0 9
asked 07 September, 2021
54 votes
30 answers
2.1K views
Undo a Git merge that hasn't been pushed yet

Within my master branch, I did a git merge some-other-branch locally, but never pushed the changes to origin m

avatar
Omar
0 1 0 9
asked 07 September, 2021
61 votes
30 answers
2K views
How to clone all remote branches in Git?

I have a master and a development branch, both pushed to GitHub. I've cloned, pulled, and fetched, but I

avatar
Percy
0 1 0 9
asked 07 September, 2021
55 votes
26 answers
2.9K views
How can I determine the URL that a local Git repository was originally cloned from?

I pulled a project from GitHub a few days ago. I've since discovered that there are several forks on GitH

avatar
Roger
0 1 0 9
asked 07 September, 2021
62 votes
30 answers
1.7K views
How to change the URI (URL) for a remote Git repository?

I have a repo (origin) on a USB key that I cloned on my hard drive (local). I moved "origin" to a NAS and succ

avatar
Leonardo
0 1 0 9
asked 07 September, 2021