If there a way to deploy with git without copying the whole meta data (history of changed)?

Dev environment: Linux

If there a way to deploy with git without copying the whole meta data (history of changed)?

I want to be able to push a certain branch, but I don’t care much about pushing the history of changes … if that possible with GIT?

  • Restrict Git Push/Pull
  • Problems organising multiple projects with Git
  • How to automatically get branches for “Branches to merge” dialog?
  • Suddenly getting “No supported authentication methods available” when pushing to github
  • Xcode 6.1 acting weird with git
  • why is a branch is present in section “local ref configured for git push” but absent in section “local branch configured for git pull”
  • Rebasing a Specific SHA1
  • gitolite/git clone no overwriting previous version
  • 2 Solutions collect form web for “If there a way to deploy with git without copying the whole meta data (history of changed)?”

    You can checkout a new branch and make a new commit with the current state:

    git checkout -b temp
    git update-ref -d refs/heads/temp
    git commit -m "Fresh commit"
    

    Push the temp branch now!

    Or try git checkout --orphan temp to create an orphan branch that behaves the same.

    Rebase using git rebase --root -i, but that will be a tedious process.

    The entire git history is stored within the .git directory off the root of your project. If you remove that directory on the deployment server, what’s left is just the current code. It’s not even technically a git project at that point.

    Details here: http://gitready.com/advanced/2009/03/23/whats-inside-your-git-directory.html

    You’re not technically “deploying” just the current code, but the end result is the same.

    Hope that’s useful.

    Git Baby is a git and github fan, let's start git clone.