12/27/2023 0 Comments Scm breezeSatisfy all of my Gemfile’s dependencies.Update all my git repos from their remotes.I’m using the whenever gem to create cron tasks that: I thought it would be great if my projects could be automatically kept up-to-date, so that I don’t have to spend too much time updating code or installing new gems. Oh, shit, git!Īn awesome site with lots of tips on how to get yourself out of trouble in Git land.A day in the life of a Rails developer will usually involve a few git pulls, bundle installs, and switching between different projects. I mostly use it for creating repositories and opening pull requests.Ĭheck out the Hub project here. Hub lets you do GitHub stuff from the command line. If you are somewhat familiar with Git and usually use the command line, install SCM Breeze. SCM Breeze is a really nice set of shortcuts for bash and zsh. It's a system for structuring and naming branches so that you can manage what's happening and still push releases on time.Ĭheck out the cheatsheet for Git Flow. Git Flow is a great way to manage a large software repository that lots of developers are hacking on. Git is yelling at me because I changed branches but my submodules didn't change too. I want to update all my local branches with all their corresponding changes from the remote. I want to update my local branch with changes from the remote. I want to catch up with the remote and delete all of my local branches that have been deleted on the remote. (This means origin/my-branch and my-branch on your local machine might be different.) git fetch I want to know what's changed on the remote, but I don't actually want to change any of the contents of my local branches. This is my first time pushing this branch to the remote. I want to rebase my branch onto another branch, but I also want to clean up, reorder, and combine some of my commits. Yes, I REALLY want to delete this local branch. Git is yelling at me because the branch has unmerged changes. I did something bad, and I lost work by overwriting a good commit. I want to go back to the last commit, but I don't want to lose any of the changes I made in the most recent commit. Now I want to nuke all the untracked files that are still around. I just ran git reset -hard which fixed all the tracked files. I really mucked up my repo and I just want to go back to the same state I was at before. ( -soft stages the stuff that was uncommitted omitting it keeps the changes unstaged) They're so tangled that I want to just un-commit everything back to a certain point, but keep the changes so I can try and fix them. I want to keep some and get rid of the rest. I made a bunch of changes that are all tangled up in each other. I have an unstaged file that's modified and I want to restore it to the last commit. I staged a file I don't actually want to commit. Save my progress without making a commit. I have to do something else with this repo quick. That is probably for the best.) git commit -am 'stuff: i did some stuff here' (This still won't commit untracked files. git commit -m 'stuff: i did some stuff here'Ĭommit all files, including the ones I haven't staged. i is for interactive.)Ĭommit all files I have staged with git add. (This launches the interactive staging tool. Give me a menu-driven tool for staging stuff. I don't like the interface of git add -p. Stage files, but only some chunks of some files, and ask me which ones. Show me what's going on with the current state of my branch. git log -graph -pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)%Creset' -abbrev-commit The holy grail: Show me all commits on all branches in a compact, colorized way. Show me commits on all branches with ASCII art to show how the branches work. Show me all commits on my branch, but don't waste my screen space this time. Show me all commits on my branch, starting now and going back until the very first commit. Learning About the Repo Learning About History I hope it helps you not hate Git so much. I've used Git since 2011, and this is the stuff that I've always had to Google to remember. A helpful primer for users sick of git's poorly-named commands
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |