- In command line:
git add .
git commit -m "[add message here]"
git push origin [branch-name]
- Go to github repo in browser and open pull request
- Merge changes
- Back in command line:
git co master
git pull origin master
If you are in another branch working on something, In command line:
git add .
git commit -m "commit message"
git checkout master
If you are in master branch with no changes to make, in command line:
git pull origin
git checkout branch_name
(if you create a NEW branch at this time, you do NOT need to rebase, only rebase if you switch to an existing feature branch. If you create a new branch, it creates the same versions from master)
git rebase master
Command line will show you which file(s) has the merge conflicts. Go into those files and delete errors/duplicates etc. When you are sure it is correct:
git add .
git rebase --continue
if you have more merge conflicts, it will tell you which file(s), if you want to ignore those files and NOT fix them:
git rebase --skip
git push origin branch_name
In feature branch:
git add .
git commit -m "commit message"
git checkout master
git pull origin master
git checkout branch_name
(if you create a NEW branch at this time, you do NOT need to rebase, only rebase if you switch to an existing feature branch. If you create a new branch, it creates the same versions from master)
git rebase master
git push origin feature-branch-name
Go to github repo in the browser and pull request/merge etc.
- Create a new repo in your github account (public, no license)
- Git clone repo to your desktop that you want to push up to your repo, navigate to the directory you want to clone it to via command line
git clone https://github.com/user_name/project_name.git
mv project_name new_project_name (if you want to change the name of the repo/project)
cd new_project_name
git remote -v (this should be the original repo location)
git remote remove origin
git remote add origin https://github.com/URL_OF_NEW_REPO (will be provided when you created the new repo in the first step)
git remote -v (double check that the origin was switched from the old repo location to your new one)
git push origin master
- Navigate to directory you want to clone/pull down in console 2.Git clone main challenge URL, ie:
git clone https://github.com/user_name/project_name.git
cd project_name
git pull origin branch_name
In the directory that git has initialized:
rm -rf .git/
- Create new repository in github
- in terminal, go into the folder and type:
git init
git add .
git commit -m "First commit"
git remote add origin https://github.com/chand/[nameofrepo].git
git remote -v
git push -u origin master
- refresh the github repo page to ensure that the files were pushed correctly.
git reset --hard HEAD
git pull origin master
git co master
git pull origin master
git co feature-branch
git merge master