Live data from Hacker News

Git Tips for Beginners Interested in Open Source

markjberger.com

1–10 of 32 posts

Re: Git Tips for Beginners Interested in Open Source

#2
Not necessarily for 'Interested in Open Source', seems like tips to anyone who isn't using a repo alone.

I don't get it the part 'Updating Master to Reflect Trunk'. What is trunk? I remember trunk from the SVN days (trunk, tag, branches) but nowadays with git I don't see this terminology anymore. Comparing to SVN trunk is the master branch. Maybe I missed something, but I don't get it this trunk remote.

Also I would put a more flashy warning on amending something that is already pushed.

Re: Git Tips for Beginners Interested in Open Source

#3
Trunk is normally called origin in git nomenclature.

git push -f needs a big red box round it, not as a normal thing to do.

If you want to fix a pushed commit, do a new commit! If you keep pushing dodgy commits, try waiting between committing and pushing, or get better at reviewing your changes.

Re: Git Tips for Beginners Interested in Open Source

#5

Trunk is normally called origin in git nomenclature. git push -f needs a big red box round it, not as a normal thing to do. If you want to fix a pushed commit, do a new commit! If you keep pushing dodgy commits, try waiting between committing and pushing, or get better at reviewing your changes.

Thanks for the comments Richard. Since Github uses origin as user's fork of the project, I was trying to distinguish the project's main repository and the user's fork. Admittedly, after seeing comments from other people, trunk probably isn't the best name for it.

Re: Git Tips for Beginners Interested in Open Source

#6
post #2

Not necessarily for 'Interested in Open Source', seems like tips to anyone who isn't using a repo alone. I don't get it the part 'Updating Master to Reflect Trunk'. What is trunk? I remember trunk from the SVN days (trunk, tag, branches) but nowadays with git I don't see this terminology anymore. Comparing to SVN trunk is the master branch. Maybe I missed something, but I don't get it this trunk remote. Also I would…

This is coming from an SVN user who is using Git, not a Git user that's providing tips to SVN users.

There's a slight difference, I think. Overtime his/her mind will change to get Git better.

Re: Git Tips for Beginners Interested in Open Source

#7
post #4

If you use "git rebase -i" a lot, you should give the "autosquash" option a try. Basically, it enables "commit --fixup " that will display the commits in the correct order the next time you rebase. (A bit hard to explain, sorry)

That's going to be really useful for my workflow. I found this explanation[1] of how it works pretty decent.

[1] https://coderwall.com/p/hh-4ea

Re: Git Tips for Beginners Interested in Open Source

#8
post #7
post #4

If you use "git rebase -i" a lot, you should give the "autosquash" option a try. Basically, it enables "commit --fixup " that will display the commits in the correct order the next time you rebase. (A bit hard to explain, sorry)

That's going to be really useful for my workflow. I found this explanation[1] of how it works pretty decent. [1] https://coderwall.com/p/hh-4ea

This is pretty cool. Thanks for pointing this out!

Re: Git Tips for Beginners Interested in Open Source

#9

Trunk is normally called origin in git nomenclature. git push -f needs a big red box round it, not as a normal thing to do. If you want to fix a pushed commit, do a new commit! If you keep pushing dodgy commits, try waiting between committing and pushing, or get better at reviewing your changes.

I've generally considered trunk to be "upstream"

Re: Git Tips for Beginners Interested in Open Source

#10

Trunk is normally called origin in git nomenclature. git push -f needs a big red box round it, not as a normal thing to do. If you want to fix a pushed commit, do a new commit! If you keep pushing dodgy commits, try waiting between committing and pushing, or get better at reviewing your changes.

Thanks for the comments Richard. Since Github uses origin as user's fork of the project, I was trying to distinguish the project's main repository and the user's fork. Admittedly, after seeing comments from other people, trunk probably isn't the best name for it.

I use 'upstream' for this purpose.
Post reply on HN