When cloning a Rails repository I have to update the mysql2 gem localy to a newer version for it to run on my machine. When creating a branch and then pull request with my changes how do I avoid adding the changed gem into the pull request?
Asked
Active
Viewed 291 times
1
-
You can stash it via `git stash` or removing from tracking or adding it to .gitignore file – Emre Savcı Aug 24 '18 at 17:41
-
Possible duplicate of [How do I configure git to ignore some files locally?](https://stackoverflow.com/questions/1753070/how-do-i-configure-git-to-ignore-some-files-locally) – arghtype Aug 24 '18 at 21:22
2 Answers
0
You can stash them, follow below sequence of operations:
git add
git commit -m
git stash -m ""
git push
Now, to reply your local MySQL file changes
git stash pop

Community
- 1
- 1

suraj singh
- 31
- 4
-
The commit I would stash is 3 commits back. How can I specifically target that commit? – Ronnie Wiesenhower Aug 24 '18 at 18:02
-
You don't stash your commit. It's non-committed files being stashed And that can retrieve by git stash pop (if you want recent stash changes) Or else You can use git stash list, which will list down all the stashes. And you can specifically apply anyone as `git stash apply {2}` eg. 3rd stash will be applied. – suraj singh Aug 24 '18 at 18:11
0
1. git fetch
This will get the latest from your remote
2. git merge origin/master
This will merge your remote master to your current branch
3. git reset --soft origin/master
This will reset your commits based on current origin/master. So all the changes that you made after the last master commit will appear as uncommitted in your current branch (staged)
4. git reset -- <filePath>
unstage a particular file
5. git commit -m "Your Commit comment"
Commit all the changes as one commit
5. git push -f origin
Force push to origin (your branch)
Note: This will converge all your Commits as one commit.

so-random-dude
- 15,277
- 10
- 68
- 113