-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgitguid.txt
More file actions
38 lines (29 loc) · 1.36 KB
/
Copy pathgitguid.txt
File metadata and controls
38 lines (29 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
…or create a new repository on the command line
git init
git add README.md
git commit -t "first commit"
git remote add origin https://github.com/chengxxf/pthbase.git
git push -u origin master
..or push an existing repository from the command line
git remote add origin https://github.com/chengxxf/pthbase.git
git push -u origin master
#################stackoverflow###################
To definitely be able to login using https protocol, you should first set your authentication credential to the git Remote URI:
git remote set-url origin https://yourusername@github.com/user/repo.git
Then you'll be asked for a password when trying to git push.
In fact, this is on the http authentication format. You could set a password too:
https://youruser:password@github.com/user/repo.git
You should be aware that if you do this, your github password will be stored in plaintext in your .git directory, which is obviously undesirable.
###################################################
#########################
Changing a remote's URL
https://help.github.com/articles/changing-a-remote-s-url/
########################
QUESTION: git produces Gtk-WARNING: cannot open display
ANSWER: unset SSH_ASKPASS
#######rebase branches to master##############
git checkout master
git pull
git checkout local_branch_name
git rebase master
git push --force # force required if you've already pushed