github cheatsheet
- This will create a new folder dedicated to the project and Move to the project directory
git init <projectName>
cd <projectName>- Add remote repo “prime”.
git remote add prime https://github.com/<repo_owner>/<projectName>
- Add remote repo “origin”.
git remote add origin https://github.com/<username>/<projectName>
- Download latest code from prime.
git pull prime master
- Create local branch for current development
git checkout –b <meaningfulBranchName>
- Add files to be committed
git add path1/filename1.c path2/filename2.h
- Commit the changes.
git commit –m”Meaningful commit message explaining what’s the purpose of the pull request and how it was implemented”
- Push to remote origin
git push origin <meaningfulBranchName>
- Open pull requests
To open the pull request, go to <username> fork on github and press “create pull request”.
git reset --hard <commit-id>
git log
git push origin <branch name>
git push origin <branch name> -f ///in case it did not accept the 'git push' command