     case Repo.insert(repository) do
       {:ok, repository} ->
         published_at = now |> DateFormat.format!("%Y-%m-%d %H:%M:%S", :strftime)
-        IO.puts published_at
         article = %Article{author_id: author.id, repository_id: repository.id, published_at: now}
         changeset = Article.changeset(article, article_params)
         case Repo.insert(changeset) do


    case Repo.update(changeset) do
      {:ok, article} ->
        IO.inspect article
        repo = %Git.Repository{path: article.repository.path}
        update_repository(repo, article)
        conn
        |> put_flash(:info, "Article updated successfully.")
        |> redirect(to: my_article_path(conn, :show, article))

  end

  defp update_repository(repo, article) do
    file_name = "index.md"
    Path.join(article.repository.path, file_name) |> File.write article.body
    Git.add repo, "--all"
    Git.commit repo, "-m 'Update'"
  end
end
