Created
March 15, 2014 16:18
-
-
Save nisar1/9569841 to your computer and use it in GitHub Desktop.
git tips
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# add all files to the index of the | |
# Git repository | |
git add . | |
# commit your file to the local repository | |
git commit -m "Initial commit" | |
# show the Git log for the change | |
git log | |
#git remote add | |
git remote add ef [email protected]:nisar1/ef.git | |
git push ef master | |
#After your first push, you can simply type: | |
git push | |
#to change the author name this is dangerious | |
git filter-branch --env-filter ' | |
an="$GIT_AUTHOR_NAME" | |
am="$GIT_AUTHOR_EMAIL" | |
cn="$GIT_COMMITTER_NAME" | |
cm="$GIT_COMMITTER_EMAIL" | |
if [ "$GIT_COMMITTER_EMAIL" = "[email protected]" ] | |
then | |
cn="nisar" | |
cm="[email protected]" | |
fi | |
if [ "$GIT_AUTHOR_EMAIL" = "[email protected]" ] | |
then | |
an="nisar" | |
am="[email protected]" | |
fi | |
export GIT_AUTHOR_NAME="$an" | |
export GIT_AUTHOR_EMAIL="$am" | |
export GIT_COMMITTER_NAME="$cn" | |
export GIT_COMMITTER_EMAIL="$cm" | |
' | |
#understanding what has happened | |
gitk HEAD @{u} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment