Reputation: 25
I want to clone the public Linux master branch from Kernel.org so I can experiment with the code on my personal computer without affecting the public branch. I have already performed git clone
and a clone resides on my computer. How would I keep my experimenting from affecting the master branch?
Note: I'm using Windows.
Upvotes: 0
Views: 90
Reputation: 9634
The best thing to do in your case is to fork the Linux master branch on github and then clone it. You can then play with your master branch and do whatever you want to do with it. In either case, nothing you do on your local master will affect the remote until you explicitly (try to) push to the remote, so not to worry. Also, you can always create another branch where you can try stuff - this is true with any project you want to work on.
Upvotes: 0
Reputation: 9541
It doesn't matter if you use windows or any other operating system. If you have your local clone of a remote repository you can do whatever you want and as long as you don't use git push origin master
the remote repository will not be affected. If you do not want to affect the local master
branch then - just create another branch (git checkout -b <branch_name>
) and work there.
I think this book is a nice read to get started with Git.
Upvotes: 4
Reputation: 265554
I'm not entirely sure I understand what you want to avoid. If you have a clone, all work you do is only local to your clone. You are not able to break something in the remote repository (you don't have push permissions anyway).
The remote tracking branch origin/master
will (after performing git fetch
) always contain the current state of the official public repository.
Upvotes: 0