3/25/2023 0 Comments Gitup mac setup fileReading the terminal may seem a bit intimidating, but this is a great chance to overcome those feelings. Further down in the terminal there will be a section called “Next steps”. If you look at the terminal output after installing Homebrew, you will see “Installation Successful!”. Note: On an Apple Silicon Mac you will have an extra step to take. Once you meet the requirements, copy and paste the following into your terminal: /bin/bash -c "$(curl -fsSL )" Make sure you have checked the requirements here. MacOSįirst, you’ll need to install Homebrew. If the version number is less than 2.28, follow the instructions again. Make sure your git version is at least 2.28 by running this command: git -version You likely have git installed already, but to make sure that we have the most up to date version of git, run the following commands: sudo add-apt-repository ppa:git-core/ppa Run these commands in the terminal to update the Linux system: sudo apt update Step 1: Install GitĬlick the Operating System you have chosen below: Linux GitHub and Git are not the same thing or even the same company. GitHub is a service that allows you to upload your code using Git and to manage your code with a nice web interface. There are many lessons focused on Git later in the curriculum. You’ll become very familiar with this piece of software throughout TOP, so don’t worry too much about understanding it at this point. Now try add additional aliases whenever seen fit… it’s as easy as that.Git is a very popular version control system. gitconfig: st = status -uno ci = commit br = branch co = checkout df = diff lg = log -p lgg = log -graph -pretty =format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)%Creset' -abbrev-commit -date =relative f = fetch Regardless of local or global, but with global is recommended, add the following block to. In other words, let’s say you have the same alias defined in local and global configurations, then the local definition would be used in for that specific repo. Perhaps worth noting that alias, or all Git configurations for that matter, are first set using local configurations, and then globally if not specified in locally. If needed later, then add unique alias to a specific project. gitconfiglocated in the root of a repository (i.e., /.gitconfig).įor aliases, typically makes the most sense to add to global configurations. Notice I referred to the configurations as being ‘global’ - ~/.gitconfig are configurations applied system-wide, and project-specific configurations get handled in. Now, in the current repo, the prompt would look like the following: matlab (master )]$Īliases, especially for Git, are typically worthwhile! If there is nothing else, at least add this feature to your global Git configurations. One of the best customization for Git, in my opinion, is displaying branch information in the terminal.įor this, simply add the following lines of text to ~/.bash_profile file: parse_git_branch() export PS1="$NO_COLOUR $BLUE\u$SSH_FLAG:$YELLOW\w$NO_COLOUR: \n$GREEN\$(parse_git_branch) $BLUE\\$ $NO_COLOUR" branch = auto diff = auto status = auto current = yellow reverse local = yellow remote = green meta = yellow bold frag = magenta bold old = red bold new = green bold added = yellow changed = green untracked = cyan For this, copy and paste the following into file ~/.gitconfig. Mac terminals can be configured to use colors to improve the display. Most definitely, specific components of Git are best displayed in color, making it easier to identifier different components and, thus, more comfortable to read.įrom the terminal run the following set of commands (i.e., from any folder): git config -global color.status auto git config -global color.branch auto git config -global color.interactive auto git config -global color.diff auto Unless you are reading this from a monochrome display, let’s take advantage of some of the color features for git. Regardless, let’s keep it simple and neat - setup a Git color scheme and branch information displayed in the terminal. These details associated with any commits that you create: git config -global user.name "Ava Paris" git config -global user.email (Optional) To remember your Git username and password when working with HTTPS repositories, configure the git-credential-osxkeychain helper. Configure your Git username and email using the following commands, replacing Ava’s name with your own. Open a terminal and verify the installation was successful by typing and running the following in the terminalĢ.Download the latest Git for Mac installer.The easiest way to install Git on a Mac is via the stand-alone installer: Open the terminal and install Homebrew by running the following command: /usr/bin/ruby -e "$(curl -fsSL )" For the sake of having the brew package manager installed, I recommend using Homebrew. It can be done a couple of different ways.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |