I have pushed a file using git-lfs in github. After pushing it, I can only see .gitattribute file changed under my commit in github like this:
file_name filter=lfs diff=lfs merge=lfs -text
There are couple of questions I want to ask:
Is .gitattribute file supposed to be changed only? Git lfs stores the reference of the file inside our repo. That reference file should be added in our repo right? Why can't I see that reference file under my commit in github?
Actual file is pushed in a different server. From where exactly can we view it?
Now when my branch gets merged with master branch, can other team members be able to access that file simply by adding git pull origin master? Obviously after they have properly configured git LFS.
git lfs ls-files
is not showing any files after adding it. Why is this so?
The commands I followed to push files with git lfs are:
1.Install git LFS using this command:
sudo apt get install git-lfs
Initialize our repository with git-lfs using following command:
git lfs install
Track the files we want to add using this command:
git lfs track filename
Make sure .gitattributes is tracked using following command:
git add .gitattributes
Remaining steps are same:
git add file-name git commit -m "File added with git lfs" git push origin branch-name
.gitattributes
should change to reflect that files with this pattern will be handled by LFS, but it should not be the only thing that has happened. The file itself should also be added and show up as modified, because the pointer file is updated every time you change a binary tracked by LFS.git status
tell you?After successfully pushing your files to GitHub, they are marked as "LFS" when you try to view them:
note a file that has previously been committed won't suddenly be converted to LFS by calling git lfs track
. The next changes may. In some cases you may want to migrate the history of your repo over to LFS, this will rewrite history, change your commit-shas and will require force-push.