1

I have a repository what is a local repository based on this repository https://github.com/AshamaneProject/AshamaneCore

I want to merge all their commits to my repository as a single commit with all the changes, how can i do it?

Im using ubuntu 17

2 Answers2

0

Do you want a local repo with all the files in that repo, but you want your repo to have only one commit, that adds all their content at once? Then you can just clone the repo, remove the .git/ directory, init a new directory and add all the files and create that single commit.

If you already have a bunch of stuff and want to add theirs, you should probably fetch their stuff without merging it, and then do some kinda squash merge. So basically like this:

  1. Add the remote
  2. Fetch the branch you want to merge
  3. Check out the branch you want to add their stuff to
  4. Merge using something like git merge <remote>/<branch> --squash (I'm not perfectly sure about the syntax for squash)

This should also handle any divergent history, so that only the new commits they have made are included in the squashed commit.

nixlarfs
  • 106
  • 8
0

As I can understand your problem, you'd like to make a clean copy of another repo and push to your own repo. If it was me, I'd do it like this:

  1. git clone / download as zip
  2. git init -> git remote add origin
  3. git commit -am "initialize commit"
  4. git push -u origin master

If you do a git clone, you can browser to the directory and delete .git folder ($cd <path-to-project>; $rm -rf *.git ) and continue from step 2.

By delete .git folder, you'll remove all previous commit/messages/logs, make it a clean new repo.

It's simply as this:

  1. $git clone <#repo-url#> . (the dot is to clone to current directory, which should be empty)
  2. rm -rf .git
  3. (start from step #2 above)
Eddie
  • 1,903
  • 2
  • 21
  • 46