Git is a version control system software that you can run on your own computer, or on a server.
GitHub is a cloud-based service for storing, sharing, and collaborating on projects managed with Git.
GitHub is the server, where your team projects are hosted.
Git allows you to communicate with Github and push/pull your files.
We will use GitHub, but be aware that there are similar services, like GitLab or BitBucket.
If you already have a Github account, make sure your powercoders.org email address is your new primary address.
Fill out your biography. Make sure to mention that you are a student or participant of the PowerCoders program.
Your GitHub Profile is like a social media profile for your code.
All
interested companies will look at your profile, projects and code
quality.
Github offers free additional benefits for schools and education programs, including partner offers.
ssh-keygen
.pub
. This is the
public key that you can share with others.
cat ~/.ssh/id_rsa.pub
to
display the public key. Example:
poco-yourname
README
or
LICENSE
git@github.com:username/poco-yourname.git
$ git remote add origin
git@github.com/user/poco-yourname.git
$ git remote -v
to view
configured remotesgit push -u origin main
-
first timegit push
- after thatThe very first time we push a commit we have to tell Git exactly how these two repositories (local and GitHub) are linked, including how they branch.
The -u
flag is used to set origin
as the upstream remote in your git config. You only
have to do that the first time and then can use
push
and
pull
without arguments.
You will probably be prompted for credentials or an authentication token.
git add [...]
to add
changesgit commit [...]
to commit the
changes locallygit push
to send the changes
to GitHub
We had add
and
commit
before, new is the command
push
git pull origin main
before
you start working on a repo that daygit push
regularlyAnyone can see the comments and comment on public repositories.
Check it out yourself and go to the conversation tab.
Comment on your buddy's repository. Request a change for example.
Github has a mechanism that allows you to contribute to someone else's repo, called "pull requests".
You do your change on a personal branch, then submit a pull request to the repo owner.
The owner (or reviewer) can then accept or dismiss the pull request, or ask for changes.
When working in a small team you do not have to use pull requests, it's mostly used for outside contributions or big teams.
It's totally normal for a pull request to require changes.
Don't be afraid to ask questions for clarification.
Most maintainers are friendly and helpful. If you encounter one who isn't, consider finding a different project worthy of your contributions.
GitHub issues are where collaborators track bugs, propose features, and discuss changes. They are for conversation, and do not actually change code.
Anyone can open or comment on an issue.
Try it yourself. Propose a feature to other participants.
On Open Source projects anyone can claim issue to solve them for the community.
If you find an issue you'd like to work on, avoid duplicating work by commenting to say you'll volunteer.
Feel free to ask questions if you need clarification before starting!