MarketShareData / Internal

MIT License
0 stars 0 forks source link

Set up new MacBook Pro git environment #1

Open gitmovin opened 9 years ago

gitmovin commented 9 years ago

Set up and document a new MacBook Pro git environment that syncs with github

gitmovin commented 9 years ago

Currently installed version of git: git version 2.3.2 (Apple Git-55)

gitmovin commented 9 years ago

Currently installed version of GitHub.app Four People and a Donut (207) You have the latest version

gitmovin commented 9 years ago

Configured MacBook Pro git instance: Name: MacOne Email: MacOne@livethecoast.com Commands: $ git config --global user.name "MacOne" $ git config --global user.email "MacOne@livethecoast.com"

gitmovin commented 9 years ago

Set up secure connection from MacOne to GitHub: Connection type: SSH Created new public/private key $ ssh-keygen -t rsa -b 4096 -C "MacOne@livethecoast.com" # Creates new ssh key File to be created: github2_rsa Passphrase: See 1Password entry for "GitHub - MacOne"

gitmovin commented 9 years ago

Add your key to the ssh-agent: Steps: $ eval "$(ssh-agent -s)" # to ensure the ssh-agent is enabled $ ssh-add -l # list any SSH keys already added to the agent (there weren't any) $ ssh-add ~/.ssh/github2_rsa # to add the SSH key to the ssh-agent

gitmovin commented 9 years ago

Add your SSH key to your account: $ pbcopy < ~/.ssh/id_rsa.pub # copies public key to clipboard Navigate to GitHub settings page, click SSH Keys, click "Add SSH key", add name, paste in public key, confirm GitHub password. Test the connection: $ ssh -T git@github.com # Attempts to ssh to GitHub - Success!

gitmovin commented 9 years ago

Connect an existing GitHub repository to MacOne: On GitHub, create or navigate to repository to be cloned Copy URL of GitHub repository using HTTPS clone URL icon On Mac, navigate to the parent folder for the to-be-created new local repository. Enter command to clone GitHub repository locally $ git clone https://github.com/gitmovin/internal.git

gitmovin commented 9 years ago

Sync local updates with GitHub: Make local updates $ git add $ git commit -m " $ git push

gitmovin commented 9 years ago

Sync GitHub updates with local repo Make updates on GitHub file, keep default "Commit directly to the master branch" selection, select "Commit Changes" $ git pull # to update local repo

gitmovin commented 9 years ago

Git Help $ git help # for command syntax $ get status # for status of local repo $ git remote -v # for list of what remote repos are connected