We now are offering Devs Base Swag. Get yours now.
https://teespring.com/devs-base-swag
http://www.zazzle.com/devs_base

[GUIDE] How to upload a repo with commit history

User avatar
Mazda
DU Lead
Contact:
Location: Milton, Florida
Has thanked: 45 times
Been thanked: 124 times
Posts: 62
Joined: Wed Sep 28, 2016 5:13 pm

[GUIDE] How to upload a repo with commit history

Sun Oct 30, 2016 1:25 am

In the time I’ve spend dealing with open source projects and just being around fellow developers, I’ve found that there are a few things that should not happen but continue on happening.

Why does this happen?
Maybe is a case of laziness, maybe they are trying to hide something, I don't know for sure but what I do know is that it should not happen.

What I’m speaking of is people uploading repos to github without commit history. It bugs the living hell out of me. It does because sometimes I’m trying to learn how to implement or fix something and without commit history, is kind of difficult to do so. After all, this is how most OSS developers learn. You look at other people's code and improve it or it helps you improve your own. A project without commit history in my opinion is not truly 100 percent open source. Commit history is key.

Like with all things, you can’t truly complain if you’re not willing to provide a solution to the problem, right?

Below I will go ahead and provide a simple step by step way of uploading a repo with commit history. I will also provide screenshots for those that learn by seeing.

Let's start!
Find that repo and copy the HTTPS clone URL
Image

Open up a terminal then type in "git clone + the https URL"
Image

Press Enter and let it do it's thing
Image

Now head over to github and create a repo, this is important
Image

Now type in the name of the repo (whatever you want) and hit "Create repository"
Image

You will be prompted with a screen like below, the bottom part is what we'll be using
Image

Open up a terminal and navigate to the repo you git cloned above
Image

Ok so when you fork a repo, you usually have a .git folder and with that it has a origin. Where it came from and what is used to know where to push to if you typed in something like git push origin or whatever. With that said, you have now git clone this repo and are wanting to upload it but yet keep commit history. So you need to type in the following command to remove the origin and have it pointing to your newly created repo

Keep in line with the step above, type in "git remote rm origin"
Image

With all repos, you have branches. Branches are generally used to create snapshots of your work but sometimes used to work on other things while keeping the main goal in place and not having to create another repo. For example, if I had a repo that is used for KitKat 4.4.2 but Google decides to push 4.5 or 5.0 or whatever and I want to keep the work I did on 4.4.2, I would simply create another branch and use it for 4.5 or 5.0 or whatever.

With that said, you need to create a branch to start things off since this will a new repo....at least for you it is.

Type in "git branch master" and you'll find sometimes it exists, sometimes it doesn't. If it does then that's good......don't freak out! Just means you don't need to do this step :)
Image

Ok after this you will need to go back to your github repo you created not so long ago and find the two lines I highlighted/had arrows pointing to and copy/paste them into terminal
Image
Image

Make sure you type in your Github username/password when prompted and the end result should look like this
Image
Image


ENJOY and hopefully this will help someone that doesn't exactly want to hide their kanging tracks but just doesn't know how to upload a repo with commit history!
Image
User avatar
MSF
Contact:
Location: India
Been thanked: 1 time
Posts: 4
Joined: Sat Oct 29, 2016 2:26 am

Re: [GUIDE] How to upload a repo with commit history

Mon Oct 31, 2016 5:25 am

Good stuff Alex!


P.S. Is it me being blind or did devs base actually dump out the useless thanks button from phpBB?

Sent from my YU4711 using Devs Base mobile app powered by Tapatalk
User avatar
Mazda
DU Lead
Contact:
Location: Milton, Florida
Has thanked: 45 times
Been thanked: 124 times
Posts: 62
Joined: Wed Sep 28, 2016 5:13 pm

[GUIDE] How to upload a repo with commit history

Mon Oct 31, 2016 5:28 am

MSF wrote:Good stuff Alex!


P.S. Is it me being blind or did devs base actually dump out the useless thanks button from phpBB?

Sent from my YU4711 using Devs Base mobile app powered by Tapatalk
Depends. If you're on the app, is currently something that the Admins/Mods are working on AFAIK but on the desktop is there for all to use :)
Image
User avatar
MSF
Contact:
Location: India
Been thanked: 1 time
Posts: 4
Joined: Sat Oct 29, 2016 2:26 am

Re: RE: [GUIDE] How to upload a repo with commit history

Mon Oct 31, 2016 5:31 am

Mazda wrote:
MSF wrote:Good stuff Alex!


P.S. Is it me being blind or did devs base actually dump out the useless thanks button from phpBB?

Sent from my YU4711 using Devs Base mobile app powered by Tapatalk
Depends. If you're on the app, is currently something that the Admins/Mods are working on AFAIK but on the desktop is there for all to use :)
Oh, cool!

Sent from my YU4711 using Devs Base mobile app powered by Tapatalk
InterestingTwist
Posts: 6
Joined: Fri Oct 28, 2016 10:08 pm

Re: [GUIDE] How to upload a repo with commit history

Tue Nov 01, 2016 2:35 am

Thanks for this awesome guide

Return to “Software Development How-Tos”

Who is online

Users browsing this forum: No registered users and 1 guest