Tutorial – Submit large files in GIT

INSTALL LFS ON RHEL/CentOS

  1. Install git >= 1.8.2
    • Recommended method for RHEL/CentOS 5 and 7 (not 6!)
      1. Install the epel repo link (For CentOS it’s just sudo yum install epel-release)
      2. sudo yum install git
    • Recommended method for RHEL/CentOS 6
      1. Install the IUS Community repo. curl -s https://setup.ius.io/ | sudo bash or here
      2. sudo yum install git2u
    • You can also build git from source and install it. If you do that, you will need to either manually download the git-lfs rpm and install it with rpm -i --nodeps git-lfs*.rpm, or just use the Other instructions. The only other advanced way to fool yum is to create and install a fake/real git rpm to satisfy the git >= 1.8.2 requirement.
  2. To install the git-lfs repo, run curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.rpm.sh | sudo bash from here
  3. sudo yum install git-lfs
  4. git lfs install

Install software on your Macbook MAC

brew install git-lfs

List type files to be tracked

git lfs track "*.psd"

git add .gitattributes

Example

git add file.psd 

git commit -m "Add design file" 

git push origin master

How to add new ssh key to github

$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
$ eval "$(ssh-agent -s)"
$ ssh-add ~/.ssh/id_rsa (regular unix system)
$ ssh-add -K ~/.ssh/id_rsa (for macbook)

$ pbcopy < ~/.ssh/id_rsa.pub (for macbook)

Paste key into github

$ git remote add origin git@github.com:xxxxxx/xxxxxxx.git  
$ git remote -v 
$ git push -u origin master

How to GIT ERROR: Repository not found. ?

$ git push origin master

ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
  and the repository exists.

Solution

Critical command line to address the issue –

Ensure ssh-agent is enabled:

Start the ssh-agent in the background

eval "$(ssh-agent -s)"