GitHub

GitHub

Moving all your Bitbucket Repositories to GitHub - Continuum

git init - initialize git in your local machine
git status - show the status of the branch
git add [name_of_the-file] - adding specific files to be committed
git add. - adding all files in the folder to be committed
git checkout -b [branch-name] - create a new branch
git commit -m 'comment' - commit and leave a comment
git push origin [branch_name] - push changes to the specified branch
git pull origin [branch_name] - pull everything from the specified branch
git remote add origin [url_of_the_branch] - adding an existing repository that was created on GitHub
git remote -v     - lists git remotes at the current directory 
git clone [url] - fetching code from GitHub to your local machine
git log - history 

Connecting to the repo via terminal: 


$ git remote add origin [remote rpo URL]
#Sets the new remote
$ git remote -v 
#verifies the new remote URL

git push -u origin main



- You can add collaborators via settings.


Workflow at Github: 

  • To contribute to the project do the followings: 
    • Fork the project to your own GitHub 
    • Clone the url of the project to your own machine
    • Do your changes
    • Push the content to GitHub
    • Then do the pull request for the permission to add your changes to original repo 
    • Add description for your changes. 






git branch -b branchName (Creating a new branch: )
git branch -d branchName (Deleting a branch)
git push origin --delete branchName (deleting branch remotely)
git branch - (switching between last used branches)


https://medium.com/@immily/sampe-of-git-workflow-for-small-team-6d5836b9b7ce








Comments