The case is, you need to work on a collaboration project, git repository is made (or maybe the project is half-way already), but you are clueless on what/how/when to start working with the repository.
what you need to do :
- Sign up to github.
- Register your public key here : Account Settings > SSH Public Keys
or run this ssh-keygen -t rsa on a console if you don't have public key yet
can be found later on ~/.ssh copy whatever inside id_rsa.pub - Run these below on your console, to set up your username & email :
$ git config --global user.name yourusername $ git config --global user.email youremail@yourdomain.com
- Ask your team leader/whoever has access to the original repository to invite you into their organization.
In case they are clueless:
Dashboard > Switch context into the organization's > Teams - Once they've invite you, go to their repository page & copy the SSH url, supposedly with the write & read access.
- Go to your terminal run :
$ git clone git@github.com:organization_name/repo_name.git $ cd repo_name
- If somehow you need the repo's branches, run this:
$ git branch -r $ git fetch origin repo_branch_name:local_branch_name
- Create your working branch like so : (here for more detailed info)
$ git push origin master:refs/heads/mynewbranchname
- Checkout to your new working branch with this line :
$ git checkout mynewbranchname
- There you go, you're all set to rock your project!
No comments:
Post a Comment