Git br shortcut mac command line
![git br shortcut mac command line git br shortcut mac command line](https://i.stack.imgur.com/436Gw.png)
![git br shortcut mac command line git br shortcut mac command line](https://aws1.discourse-cdn.com/standard10/uploads/codewithmosh/original/1X/e95fce6619fc26d6eb33a0524d3514bddc22e8af.jpeg)
These commands are used in conjunction with SVN. The following commands are for pushing, pulling, pulling and rebasing. These commands are used for checking out to a new branch, checking out to another branch, creating branch from an existing branch, deleting branch, etc. Llg = log -color -graph -pretty=format:'%C(bold white)%H %d%Creset%n%s%n%+b%C(bold blue)%an %Creset %C(bold green)%cr (%ci)' -abbrev-commit
![git br shortcut mac command line git br shortcut mac command line](https://phoenixnap.com/kb/wp-content/uploads/2021/04/download-git-for-mac.png)
Lg = log -color -graph -pretty=format:'%C(bold white)%h%Creset -%C(bold green)%d%Creset %s %C(bold green)(%cr)%Creset %C(bold blue)%Creset' -abbrev-commit -date=relative L = log -graph -all -pretty=format:'%C(yellow)%h%C(cyan)%d%Creset %s %C(white)- %an, %ar%Creset' Some are used for displaying pretty graphs, which I had discussed in Git Standards followed in our way of Spotify Agile Methodology. If you wanna see the commit log, here they are. This doesn't mean the unsaved changes, but also those that are saved will be lost. These are the commands that remove your current changes that aren't committed. Git unhide secret.txt # File will be tracked normally. Unhide = update-index -no-assume-unchangedĮxamples git hide secret.txt # File stays committed in the repo, but will not be tracked. One best way to do is to edit the global config file using git config -global -edit and add the aliases as shown below: If we are going to use this command frequently, it is better we create an alias for these two commands. In the above command, the denotes a single file like the above config.js or a file pattern like say secret/*. This is for git to temporarily ignore the changes to a particular file. Any changes to this file will be untracked. This will remove the file from the list of tracked files. To do this, what I did was I told git to assume that the file is always unchanged. gitignore, git keeps a track of that file always other than in the situation you explicitly tell git to ignore it for a reason. This is because, even though you have added the file in the. This is a problem I faced when I committed the file and changed it. The -cached flag is used when you have already staged the changes for commit and you haven't committed yet. These commands are used to see what has changed. Uc = !git reset -soft HEAD^ & git reset HEAD. Ĭa = commit -amend # Be careful with this one. It's really dangerous when you use it during merging or when pulling and before committing at least once. Please use the ca or -amend flag along with commit with caution. The acm shortcut is a complete one, which will also allow you to add a commit message on the line and complete the commit. These commands are used for adding the unstaged files, staging them, and then committing them too. They are used to check the status of the current working directory, adding all the files, displaying the status, etc. The following commands are the basic ones that are used often. I have grouped the shortcuts into sub-sections, where you can find all the related shortcuts grouped by its similarity in functions.Ĭopy only those you need. You have to place all the aliases under the section with a tab or four space front of each shortcut. When you open with or without the -global keyword, you will be shown a configuration file. This will open up a text editor and you can safely put stuff inside. Well, instead of using the above command git config, I would strongly recommend developers to use the other command: git config -edit -global
![git br shortcut mac command line git br shortcut mac command line](https://rubygarage.s3.amazonaws.com/uploads/article_image/file/600/git-cheatsheet-6.jpg)
I have included a simple demonstration of where all git would store the configuration and consolidate them and uses it in your repository. gitconfig and not anywhere else.īonus: Wanna know where all git stores its configuration? have a look at Best way to import or export the Git Configuration. If that's not given, the shortcut will be applied only to the current repository and it will be stored in. Note that in the above command, there's a flag -global, which makes the shortcut available for all the git repositories. To create an alias in git, the complete syntax is: git config alias.alias_name git_commandįor example, if you want to cut short git status to git s, you need to issue this command: git config -global alias.s status While creating a shortcut, we will be using the command alias. I thought it would be a nice gesture to share the details with the world of developers. Completely eradicating my mouse is one of the best things I did as it boosted my productivity more than twice. Being a power user I cannot stress more on the fact that I need to be super-productive when it comes to programming and development.