git - GitHub - How to push a project on its latest stage, ignoring all old commits? -


i've project want push github, want push on actual stage without older commit. how can it?

edit. i've created separet branch it, want push branch without other commit other branchs. i'm doing because i've added late gitignore , files in git ignore being versioned , purpose of branch/repository review actual code of few folders.

figure out base of branch:

git merge-base {basebranch} head 

use command soft reset branch before first commit:

git reset --soft {hashofcommitforyourbase} git add .; git commit -m "my new message" 

then push force:

git push --force 

Comments

Popular posts from this blog

How to understand 2 main() functions after using uftrace to profile the C++ program? -

c# - Update a combobox from a presenter (MVP) -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -