Git hooks are scripts that run automatically every time a particular event occurs in a Git repository. They let you customize Git’s internal behavior and trigger customizable actions at key points in the development life cycle.
Git pull is command used to get files from the remote repository directly into the working directory. It is equivalent to a git fetch and a git merge. Now that we know what Git is and it’s basic terminologies, let’s see how we can place a file under git. We’re going to do it the right way and the difficult way. Without any GUI applications.
with the Github for Mac app
From the repositories view in the app, drag the project folder to the bottom of the left sidebar.
Hit 'Yes' when it asks if you want to create a local git repository
Go to 'Changes' view (⌘2)
Select the files that you want to commit their current state to the repository. You can view the changes of the file by clicking on the double up arrow on the file name bar.
Type a commit summary, usually a description of what you've just added or changed.
Click 'Commit'. This commits the current state of the code to your local repository. Do this every time to do something significant like fix a bug or develop a feature. Commit early and often. Each state of code is available to you at any time via the History view (⌘1).
with the command line
Open Terminal.app
'cd' to directory
Initiate a git repository
Git Language Mac Os
Add existing files
Commit all files (-a) and add a message (-m)
Cloning (checking out) someone else's repository
with the Github for Mac app
Visit the repo on Github.com and click the 'clone to Mac' button, or..
Select the repo in the Repositories list within the app, under the cremalab account.
with the command line
'cd' to desired directory
clone the repo with the clone url
Syncing repository branches with a remote repository
with the Github for Mac app
Make sure you have committed the current state of your code
Drill into your repo in the app and click Sync Branch in the upper right corner. This pulls down the latest code from the remote repository, merges your code with it, and pushes your changes to the remote repository.
If you only want to get the latest code from the remote repo, select Repository > Pull (⇧⌘P) from the menu bar. This merges the remote code with your local code but does not push up your changes.