https://chris.beams.io/posts/git-commit/
- Create new repository on github
- copy https code downlod url
- In Git bash do:
git clone https://restoftheurl.com/repositorymadejjustnow.git
# make sure to not use ctrl+v to paste in git bash, it will add hidden ^? or something.
git add . git commit -m "first commit"
First create a local repository
add remote repository origin to local repository
merge the two repsitories
Basic Git commands for future reference
Open ~/.ssh/id_rsa.pub and then copy the key from the file. At last add the key in the github ssh keys in settings.
git config --global user.name "name"
git config --global user.email "email"
git clone url-of-repository
create a git repository
show all the changes made
add to the changes you want to track
save a version of this repository
add + commit
shows currentstatus of repository
send commited changes to remote repository
pull the changes made in the remote repository
shows history of commits and messages
reset to a previous commit
git reset --hard origin/master, back to remote repository version
int a = 1;
<<<<<<<<<<<< HEAD
int b = 2;
============
int b = 0;
>>>>>>>>>>>> 5428973695827389457345e
int c = 3;
int d = 4;
Keep the line you want to keep and delete everything else in the conflict
shows all branches
new branch
switch to a branch
new branch and switch to it
merges with current branch
delete branch (-d gives a soft delete)